Is it harassment if I tell a girl she's very beautiful ?

Today at the grocery store I saw very beautiful girl with a lovely smile , wanted to say you are beautiful to her but got scared thought she might see that as harassment , Im not the best looking guy out there

Was my thoughts wrong?

Updates
1 y
I'm going to be a wiser man and not approach/not compliment stranger women or any woman unsolicited unasked etc
Is it harassment if I tell a girl she's very beautiful ?
Post Opinion