擅长:python、mysql、java
<p>试试下面的方法。它将从该网站获取表格数据:</p>
<pre><code>import requests
from bs4 import BeautifulSoup
res = requests.get("https://en.wikipedia.org/wiki/Comparison_of_Intel_processors")
soup = BeautifulSoup(res.text, 'lxml') #if you find any problem with "lxml" then try using "html.parser" instead
table = soup.find("table",class_="wikitable")
for items in table.find_all("tr")[:-1]:
data = [' '.join(item.text.split()) for item in items.find_all(['th','td'])]
print(data)
</code></pre>
<p>部分输出:</p>
^{pr2}$