What am I doing wrong? - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html) +--- Thread: What am I doing wrong? (/thread-37070.html) |
What am I doing wrong? - Larz60+ - Apr-28-2022 I'm trying to wait for browser to see the first part of a string using: ltext = f"Page {sw['current_page']}" element = WebDriverWait(self.browser, delay).until( \ EC.presence_of_element_located((By.PARTIAL_LINK_TEXT(ltext))))value of sw['current_page'] is 2, so ltext is 'Page 2' the page text is: 'Page 2 of 76, records 26 to 50 of 1878' URL: https://bizfilings.vermont.gov/online/BusinessInquire/ receiving the following error: Waiting on Partial text is new to me, what am I doing wrong?
RE: What am I doing wrong? - DeaD_EyE - Apr-29-2022 Try this: EC.presence_of_element_located((By.PARTIAL_LINK_TEXT, ltext)))Reference: https://selenium-python.readthedocs.io/waits.html?highlight=ec.#explicit-waits RE: What am I doing wrong? - Larz60+ - Apr-29-2022 DeaD_EyE Wrote:Try this: This works properly, thanks. I had another (novice) error as well, forgot to increment page number. |