I have been trying to scrape data from a flight website. This is the code I wrote:
todays_date = str(date.today())
arrival_filename = todays_date+"Arrival_Data_IGI.csv"
res = requests.get("https://m.newdelhiairport.in/live-flight-
information.aspx?FLMode=A&FLType=D")
soup = BeautifulSoup(res.content,'lxml')
table = soup.find_all('table',{'id':'fids_row'})
df = pd.read_html(str(table))
arrival = df[0]
arrival_filename = todays_date+"_Arrival_Data_IGI.csv"
arrival.to_csv(arrival_filename)
arrival.to_csv("Arrival_Data_IGI(daily).csv")
But an error came when I ran the code. Error that came:
When I tried to install html5lib using pip install html5lib
, following error came:
Error while installing any library or upgrading pip.
"Could not fetch URL https://pypi.org/simple/pip/ : There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1051)'))) - skipping"
You should upgrade pip
. This solution (from this github conversation) can solve the problem:
python -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --upgrade pip
If you are using Windows, there may at times be issues when installing packages on 64-bit version.
You can download the 64-bit version of the library from here .
Then open Command prompt on the path where you have downloaded the file and type
pip install "name of the package".whl
Since the downloaded file is a wheel file.
Or you can download the required packages from Anaconda-Navigator.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.