I am trying to create a table scrape with BeautifulSoup. I wrote this Python code:
import urllib2
from bs4 import BeautifulSoup
url = \"http://dofollow.nets
# Libray
from bs4 import BeautifulSoup
# Empty List
tabs = []
# File handling
with open('/home/rakesh/showHW/content.html', 'r') as fp:
html_content = fp.read()
table_doc = BeautifulSoup(html_content, 'html.parser')
# parsing html content
for tr in table_doc.table.find_all('tr'):
tabs.append({
'Nome': tr.find_all('td')[0].string,
'Cogname': tr.find_all('td')[1].string,
'Email': tr.find_all('td')[2].string
})
print(tabs)