Posted April 13, 2020 How to set this start in my Python WebCtach Project,I want it to continuly to catch the data i want.Thanks a lot! Here is my project under bellow import requests import bs4 link="https://movie.douban.com/top250" headers={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Safari/537.36"} r=requests.get(link,headers=headers) r.encoding="utf-8" html=r.text bs=bs4.BeautifulSoup(html,"html.parser") div_lst=bs.find_all("div",{"class":"info"}) for span in div_lst: name=span.find("span",{"class":"title"}).string score=span.find("span",{"class":"rating_num"}).string if float(score)>9.5: print(name) print(score) print("------------------------------") Link to comment Share on other sites More sharing options... Link to post Share on other sites More sharing options...
Posted April 13, 2020 Author BTW,My teacher only told us to catch three pages for homework Link to comment Share on other sites More sharing options... Link to post Share on other sites More sharing options...
Posted April 13, 2020 4 minutes ago, Spirit`yL said: BTW,My teacher only told us to catch three pages for homework 0_0 did you try googling it? I am NOT a professional and a lot of the time what I'm saying is based on limited knowledge and experience. I'm going to be incorrect at times. Motherboard Tier List How many watts do I need? Best B550 Motherboards Best Intel Z490 Motherboards PC Troubleshooting You don't need a big PSU PSU Tier List Common pc building mistakes PC BUILD Guide! (POV) How to Overclock your CPU Link to comment Share on other sites More sharing options... Link to post Share on other sites More sharing options...
Posted April 13, 2020 Author I found there is a name"start" behind each url,and how to set this thing variable? Link to comment Share on other sites More sharing options... Link to post Share on other sites More sharing options...
Posted April 13, 2020 Author Just now, InnerBeast Gaming said: 0_0 did you try googling it? No ,i try it on Baidu,but the things they tell and teach......well i dont understand it cause i my a beginner Link to comment Share on other sites More sharing options... Link to post Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now