Home > other >  Spiders crawl the code at no problem but the output is only one "[]", turn to your bosses
Spiders crawl the code at no problem but the output is only one "[]", turn to your bosses

Time:09-21

The output is: []


The import requests
The from bs4 import BeautifulSoup
Url="https://movie.douban.com/top250"
Hd={' the user-agent ':' Mozilla/5.0}
db_data=https://bbs.csdn.net/topics/requests.get (url, headers=hd)
Soup=BeautifulSoup (db_data. Text, 'LXML')
Titt=soup. Select (' div. Hd & gt; D ')
Print (titt)

CodePudding user response:

Find the problem titt=soup. Select (' div. Hd & gt; D) this code should be titt=soup. Select (' div. Hd & gt; A ')

CodePudding user response:

reference 1st floor aaaa12123424 response:
find question the titt=soup. Select (' div. Hd & gt; D) this code should be titt=soup. Select (' div. Hd & gt; A ')

Thumb up for themselves to solve the problem

CodePudding user response:

reference 1st floor aaaa12123424 response:
find question the titt=soup. Select (' div. Hd & gt; D) this code should be titt=soup. Select (' div. Hd & gt; A ')


Congratulations to the building Lord, electing the building Lord!
  • Related