Using this awesome code I can scrape the majority of the data, however it seems like some of the url's may not scrape. Also I need to be able to identify the data source in the future. Therefore I have two question:
how to program in a check that all links are identified and scraped?
how to insert the url link as a new column so each row is identified?
url = 'https://www.rootsandrain.com/organiser21/uci/events/filters/dh/' response = requests.get(url) soup = BeautifulSoup(response.content) urlList = ['https://www.rootsandrain.com'+row.a['href'] for row in soup.select('#T1 tbody tr')] data = [] for url in urlList: try: data.append(pd.read_html(url)[0]) except: print(f'No tables found:{url}') pd.concat(data)
Original post