I need to read a list of webpages. For instance I have a web that works
url1 = 'https://www.sia.ch/en/membership/member-directory/m/207778/'
driver = webdriver.Chrome('/Users/massaro/research/Valeria/chromedriver 2')
driver.get(url1)
html = driver.page_source
html = str(html).replace('<br />', '::')
df1 = pd.read_html(html)[0].iloc[[0,2],1]
than I have another page for which I get the error
url2 = 'https://www.sia.ch/en/membership/member-directory/m/105531/'
driver = webdriver.Chrome('/Users/massaro/research/Valeria/chromedriver 2')
driver.get(url2)
html = driver.page_source
html = str(html).replace('<br />', '::')
df1 = pd.read_html(html)[0].iloc[[0,2],1]
ValueError: No tables found
I would like to have a condition to skip webpages that have no tables in order to avoid the error.