![](/img/trans.png)
[英]How to find a particular word in html page through beautiful soup in python?
[英]How to find a particular URL in an HTML file with python?
我的 HTML 文件中有一个带有 .bin 附件的 URL。
我的目标是使用我的 Python 脚本提取完整链接。 我在许多 HTML 文件中运行此脚本,.bin URL 的位置可能会更改。
如果我能够获得 URL 开头和结尾的索引,我可以通过这种方式提取它。
我尝试通过 HTML 文件进行单词搜索,但有几个 .bin URL,我只想要第一个。 任何想法,将不胜感激。 或任何其他方法。
import urllib.request, urllib.error, urllib.parse
html_link = "www.mywebsitelink.com"
response = urllib.request.urlopen(html_link)
webContent = response.read()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.