iterate over meta tag python

Solutions on MaxInterview for iterate over meta tag python by the best coders in the world

showing results for - "iterate over meta tag python"
Fabio
04 Jan 2020
1import urllib.request
2from bs4 import BeautifulSoup
3
4f = open('out.txt','w')
5
6url = "http://www.international.gc.ca/about-a_propos/atip-aiprp/reports-rapports/2012/02-atip_aiprp.aspx"
7page = urllib.request.urlopen(url)
8
9soup = BeautifulSoup(page)
10
11soup.unicode
12
13table1 = soup.find("table", border=1)
14table2 = soup.find('tbody')
15table3 = soup.find_all('tr')
16
17for td in table3:
18    rn = soup.find_all("td")[0].get_text()
19    sr = soup.find_all("td")[1].get_text()
20    d = soup.find_all("td")[2].get_text()
21    n = soup.find_all("td")[3].get_text()
22
23    print(rn + "," + sr + "," + d + ",", file=f)
24
similar questions
queries leading to this page
iterate over meta tag python