我想删除以下网站的结果名称:RAJASTHAN TECHNICAL UNIVERSITY, KOTA
下面是我当前用Python编写的代码:
import requests
from bs4 import BeautifulSoup
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}
response = requests.get(url, headers=headers)
soup = BeautifulSoup(response.text, "lxml")
print(soup)
尝试打印soup时出现以下错误:
Couldn't access the inner elements of frame name="mainFrame" src="mainpage.php"/>
有一个iframe需要处理。您可以改为使用iframe src作为起点,并为POST请求收集所需的参数,该请求与page对结果所做的操作相匹配
相关问题 更多 >
编程相关推荐