Something or somebody is beautiful if it is pleasant to see it.
Somebody is attractive if you enjoy their company and you have the desire to touch them and engage in activities that would cause mutual pleasure.
These are distinct feelings, even if there exists some correlation between them, mostly because when you consider somebody ugly, you are unlikely to be attracted to them. The reverse is not true, you can consider someone as very beautiful without feeling the slightest attraction toward them.
The connection between beauty and pleasantness seems to be much weaker than suggested.
There are things that are pleasent and lack any form of particular beauty. To mind come, interior decoration, roman statues, tiktok-videos..
And there are things that have inherent beauty partly because of their wretchedness and being unpleasant. Prime example would be greek tragedy. You and the protagonist know that it will end horribly and it is almost torture to see it unfold. But still, it is beautiful.
To go a bit deeper on attration and beauty. My personal experience showed me that beauty tends to be a (surprisingly low) threshold requirement for attraction.
I have referred to "beautiful" only with its strict concrete meaning, as applicable to the sensation caused by something you are looking at, like a beautiful flower, a beautiful waterfall or a beautiful human.
You have also used "beautiful" in its generalized abstract sense, when it becomes applicable to things like a beautiful mathematical theorem or a beautiful computer algorithm.
In the second sense of the word, there is no relationship with the attractiveness of a human. In the first sense of the word, I recognize anything beautiful when I see it, without thinking about a reason. In the second sense, I realize that something is beautiful only after an intellectual analysis of it.
Also in the first sense, the word "beautiful" is frequently reused for other sensations than vision, e.g. for a beautiful song or a beautiful fragrance, though it would have been better to have distinct words for these cases.
Something or somebody is beautiful if it is pleasant to see it.
Somebody is attractive if you enjoy their company and you have the desire to touch them and engage in activities that would cause mutual pleasure.
These are distinct feelings, even if there exists some correlation between them, mostly because when you consider somebody ugly, you are unlikely to be attracted to them. The reverse is not true, you can consider someone as very beautiful without feeling the slightest attraction toward them.