【发布时间】:2021-12-20 13:42:27
【问题描述】:
import requests
from bs4 import BeautifulSoup
import pandas as pd
headers= {'User-Agent': 'Mozilla/5.0'}
#put all item in this array
response = requests.get('http://smartcatalog.emo-milano.com/it/espositore/a-mannesmann-maschinenfabrik-gmbh')
soup = BeautifulSoup(response.content, 'html.parser')
table=soup.find_all('table', class_='expo-table general-color')
for row in table:
for up in row.find_all('td'):
text_list = [text for text in up.stripped_strings]
print(text_list)
这些代码运行良好,它们会给我正确的输出,但它们不会提供这些格式的输出,如下所示我想要这些格式的输出,你能帮帮我吗
Indirizzo Bliedinghauserstrasse 27
Città Remscheid
Nazionalità Germania
Sito web www.amannesmann.de
Stand Pad. 3 E14 F11
Telefono +492191989-0
Fax +492191989-201
E-mail sales@mannesmann.de
Membro di Cecimo
Social
【问题讨论】:
标签: python dataframe web-scraping beautifulsoup