I am learning web scrape using BeautifulSoup.
Trying to extract the different elements from the HTML, but there is a problem when I extract data from meta tag. The list for meta is as below picture:
or slist6 pasted as below:
[<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>, <meta content="width=device-width,initial-scale=1" name="viewport"/>, <meta content="no-referrer" name="referrer"/>, <meta content="never" name="referrer"/>, <meta content="VPPXtECgUUeuATBacnqnCm4ydGO99reF-xgNklSbNbc" name="google-site-verification"/>, <meta content="034F16304017CA7DCF45D43850915323" name="msvalidate.01"/>, <meta content="" name="description"/>]
The attribute as content works in the code but doesn't work for name. It shows Keyerror: name, The results of the codes as below picture. May I ask for your help on how to get the name attribute? Thanks.
slist1.find_all('meta')
instead of attaching a screenshot of it. This would make testing easier – Sushil