我正在尝试在同一Python调用中提取多个网站。我无法使其正常工作,并且不得不单独输入每个电话。
我已经尝试执行以下操作:
URL = ['https://sc2replaystats.com/replay/playerStats/10758933/83445': https://sc2replaystats.com/replay/playerStats/10758969/83445]
content = requests.get(URL)
soup = BeautifulSoup(content.text, 'html.parser')
contentTable = soup.find('table', "table table-striped table-condensed")
rows = contentTable.find_all('span', "blizzard_icons_single")
print (rows)
这是我当前的代码:
from bs4 import BeautifulSoup # BeautifulSoup is in bs4 package
import requests
URL = 'https://sc2replaystats.com/replay/playerStats/10758969/83445'
content = requests.get(URL)
soup = BeautifulSoup(content.text, 'html.parser')
contentTable = soup.find('table', "table table-striped table-condensed")
rows = contentTable.find_all('span', "blizzard_icons_single")
print (rows)