【题解】Assignment: Following Links in HTML Using BeautifulSoup (Using Python to Access Web Data)

这篇博客讲述了如何使用Python的BeautifulSoup库解析HTML,从指定位置的链接开始,按顺序跟随链接并重复此过程以找到最后的名字。博主分享了解题策略和代码实现,并遇到了实际运行时速度过快可能导致的网站响应问题,尝试了加入time.sleep()来避免,但问题未完全解决。
摘要由CSDN通过智能技术生成

吐槽:好难哦...而且有个问题我一直不知道呢还,若有大佬看到这篇文章希望帮忙解决一下疑惑,感谢w

题目:Following Links in Python

In this assignment you will write a Python program that expands on http://www.py4e.com/code3/urllinks.py. The program will use urllib to read the HTML from the data files below, extract the href= vaues from the anchor tags, scan for a tag that is in a particular position relative to the first name in the list, follow that link and repeat the process a number of times and report the last name you find.

We provide two files for this assignment. One is a sample file where we give you the name for your testing and the other is the actual data you need to process for the assignment

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值