问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图
targets2 = soup.find("div", class_="hd").select('span:nth-of-type(2)')
运行结果及报错内容
只能找到一个"div", class_="hd"的第二个span,但是用了find_all又不能用select。
我的解答思路和尝试过的方法
targets2 = soup.find_all("div", class_="hd")
只能获取第一个span
targets = soup.find_all("span", class_="title")
又会同时获取多个class_="title"的电影名
我想要达到的结果
想要爬取所有豆瓣top250电影第二个电影名