2024-06-28 11:00:03 发布
网友
我想打开一个网站从中下载简历,但下面的代码尝试获取绝对路径而不是url:
import webbrowser soup = BeautifulSoup(webbrowser.open('www.indeed.com/r/Prabhanshu-Pandit/dee64d1418e20069?sp=0'),"lxml")
生成以下错误:
很明显,它正在获取家庭住址,并试图在网络上搜索那些不会出现的地址。我做错什么了?提前谢谢
我想你是在混淆靓汤和网吧的用法吧。不需要访问网页。在
来自Documentation
Beautiful Soup provides a few simple methods and Pythonic idioms for navigating, searching, and modifying a parse tree: a toolkit for dissecting a document and extracting what you need. It doesn't take much code to write an application
使tutorial example适应您的任务,以便在输出中打印简历
from bs4 import BeautifulSoup import requests url = "www.indeed.com/r/Prabhanshu-Pandit/dee64d1418e20069?sp=0" r = requests.get("http://" +url) data = r.text soup = BeautifulSoup(data, "html.parser") print soup.find("div", {"id": "resume"})
我想你是在混淆靓汤和网吧的用法吧。不需要访问网页。在
来自Documentation
使tutorial example适应您的任务,以便在输出中打印简历
相关问题 更多 >
编程相关推荐