Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Pakistan scraper to wait for presence of update time on page #69

Open
zstumgoren opened this issue Jul 10, 2020 · 0 comments
Open

Comments

@zstumgoren
Copy link
Member

Update to pak.py to use a more nuanced wait strategy (such as non-working solution below) rather than increasing sleep timers to ensure presence of page elements.

            from selenium.webdriver.common.by import By
            from selenium.webdriver.support import expected_conditions as EC
            from selenium.webdriver.support.ui import WebDriverWait
            wait = WebDriverWait(driver, 30)
            xpath_query = '/html/body/app-bootstrap/ng2-bootstrap/bootstrap/' +\
                'div/div/div/div/div[1]/div[2]/div/div[1]/div[1]/div[1]' + \
                '/div/lego-report/lego-canvas-container/div/file-drop-zone/' + \
                'span/content-section/canvas-component[20]/div/div/div[1]/' + \
                'div/div/lego-table/div/div[3]/div/div'
            element = wait.until(
                EC.text_to_be_present_in_element(
                    (By.XPATH, xpath_query),
                    'Last updated on'
                )
            )


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant