I extract some data from a html page. My output is:
0
0
0
0
131997
https://www.google.com.ar/
google.com.ar
0
0
0
0
134930
https://www.a-a.com/
a-a.com
And I'm looking for this kind of output:
[['0','0','0','0','131997','https://www.google.com.ar/','google.com.ar'],['0','0','0','0','134930','https://www.a-a.com/','a-a.com']]
Here is my python code:
sitios = requests.get(url_sitios, auth=HTTPBasicAuth(user, passwd))
sitios2 = sitios.text
html = sitios2
soup = BeautifulSoup(html, 'lxml') #add the 'lxml' parser
for item in soup.find_all(['nombre', 'url', 'sitio_id', 'ultimas24hrs']):
a = item.text + ','
print a