I'm scraping a VUE.js website and when I have debug mode turned on in Selenium it can locate and click a drop down button but when I run it in normal mode it throws the following error message:
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element <select id="sortselectbox" data-ph-at-id="search-page-sort-drop-down" class="form-control au-target" value.bind="searchParams.sortBy" change.delegate="sortfilterSearch()" tabindex="0" data-ph-id="ph-page-element-page20-4VGGDW" au-target-id="169">...</select> is not clickable at point (707, 444). Other element would receive the click: <div class="chatBotNotificationText" tabindex="0">...</div>
(Session info: headless chrome=96.0.4664.110)
Here's how I'm finding the dropdown button
Order = driver.find_element_by_xpath("//*[@id='sortselectbox']")
Before that here's how I scroll to the top of the website so that the sortselectbox
become visible for the driver
driver.execute_script("window.scrollTo(0, 220)") #Page up
Here's the HTML element
<select id="sortselect" data-ph-at-id="search-page-sort-drop-down" class="form-control au-target" value.bind="searchParams.sortBy" change.delegate="sortfilterSearch()" tabindex="0" data-ph-id="ph-page-element-page20-UCZFWs" au-target-id="150"> <option value="Most relevant" key="c-internal-digital-technology-it-53pxnB-ph-search-results-v2-view4-mostRelevantText" data-ph-id="ph-page-element-page20-srcQGN"> Most relevant </option> <option value="Most recent" key="c-internal-digital-technology-it-53pxnB-ph-search-results-v2-view4-mostRecentText" data-ph-id="ph-page-element-page20-Br2Xo6"> Most recent </option> </select>
I've tried adding more sleep before and after the scroll but it seems it's failing at that step. All signs are indicating that scrolling doesn't work in normal mode. Would I have to find another way locating that sortselectbox
button without the use of the window.scrollTo
script?
Thanks!