I've written a script that gets data from a page, but sometimes the page takes time to load and so when it pull the html into a soup object sometimes It pulls nothing as the page still needs to finish.
I wrote the following code for waiting the page to finish.
def scrape_page(url): browser.get(url) try: WebDriverWait(browser, 10).until(EC.presence_of_element_located(browser.find_element_by_id ("selection-box"))) #Extract Source Code html = browser.page_source; soup = BeautifulSoup(html) It works
But I'm getting the following error when I call the function;
TypeError: find_element() argument after * must be a sequence, not WebElement