Current location - Quotes Website - Personality signature - Why do python crawlers keep crawling the same thing like this, and how should they crawl the content under other td tags?
Why do python crawlers keep crawling the same thing like this, and how should they crawl the content under other td tags?
Import? Request?

From where? bs4? Import? Beautiful voice

Import? about

headers = { ' User-Agent ':' Mozilla/5.0? (Windows? NT? 6. 1; ? WOW64)? AppleWebKit/537.36? (KHTML,? Like what? Gecko)? Chrome/49.0.2623.22 1? Safari/537.36? SE? 2.x? MetaSr? 1.0'}

ALL=[]

def? Get the URL:

url='/position.php? keywires = Test & amp; Tid = 0 & Start =% s # a "%s"

req=requests.get(url,headers=headers,timeout=3)

res=req.content

soup=BeautifulSoup(res,' lxml ')

s=soup.select('table.tablelist? tr’)

Text=s[ 1:- 1]

For what? Me? Are you online? Text:

Job={' job name': None,

Location Category': None,

Number', None,

Location': None,

Release Time': None}

L=i.text.strip('?' )). Split ('?' )

Job ['position name' ]=L[0]

Job ['position category' ]=L[ 1]

Job[' number of people' ]=L[2]

Job ['location' ]=L[3]

Job ['Release Time' ]=L[4]

ALL.append (job)

For what? Me? Are you online? Range (0, 10 1, 10):

Get the website (1)

Print(ALL) Your question should be about the field key, which is unique. Multiple results will be overwritten, and adding a list to express them can avoid this problem.