写一段python代码 解析httpsmokooocommatchchangephpmid=1194233&pid=24&Type=odds中的公司名称和链接地址将解析的结果打印
import requests from bs4 import BeautifulSoup
url = "https://m.okooo.com/match/change.php?mid=1194233&pid=24&Type=odds" response = requests.get(url) soup = BeautifulSoup(response.content, 'html.parser') companies = soup.find_all('a', class_='company') for company in companies: name = company.get('title') link = company.get('href') print(name, link)
原文地址: https://www.cveoy.top/t/topic/dxEm 著作权归作者所有。请勿转载和采集!