Jun-24-2019, 06:09 AM
(Jun-23-2019, 08:58 PM)eddywinch82 Wrote: But the format is different, to the previous BBMF Year Schedules. Can you look at the Webpage, and suggest to me, what I need to change in my CodeYou have to look at the source code of new site an make changes.
Should keep away from new task in this Thread as it already long,and you most try yourself and post code.
So a last tips last for new site,you most do more accurate search for the table needed on that site.
import pandas as pd import requests from bs4 import BeautifulSoup res = requests.get("http://web.archive.org/web/20041020000138/http://www.raf.mod.uk/bbmf/displaydates.html") soup = BeautifulSoup(res.content,'lxml') table = soup.find_all('table', align="CENTER")[0] df = pd.read_html(str(table)) # Clean up,put index(Date location...) at top,delete 2 first row df = df[0] df = df.rename(columns=df.iloc[0]) df = df.iloc[2:] df