nateshmbhat / webbot

Web automation library for simple and easy end to end testing and web browser automation that offers super charged features while keeping it simple to use and master
https://pypi.org/project/webbot/
Mozilla Public License 2.0
239 stars 87 forks source link

exists() css_selector problems with attribute selectors #47

Open chessboards opened 3 years ago

chessboards commented 3 years ago

https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors https://www.w3schools.com/cssref/css_selectors.asp

if web.exists(tag='button', classname='yt-icon-button', css_selector='button[aria-label*="Current setting is all notifications."]', number=1, loose_match=False):
        return 0 # can't enable push notifications
    else:
        return 1

Running the following code when logged into Youtube, 1 is returned instead of 0. The method should detect if the button exists based on the aria-label css_selector.

Either it is Youtube, or the webbot library, but the css selector doesn't seem to work here. This was tested in an environment with purely the button's element in the html body. A JS querySelector in a script element with the same css_selector worked fine in contrast.

issue-label-bot[bot] commented 3 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.86. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.