Home > other >  Python freshman of new help
Python freshman of new help

Time:05-20

Strives for the big help to see where I went wrong, when climbing provinces have been regular leakage climb

CodePudding user response:

Such a simple site don't use the selenium, can get this done in a simple requests, don't even need headers

 import requests 
The from LXML import etree


Url='https://zhaosheng.upc.edu.cn/static/front/upc/basic/html_web/lnfs.html'
The response=requests. Get (url)
Data=https://bbs.csdn.net/topics/etree.HTML (the response text)
City=data. Xpath ('//dd [@ data - param="the SSMC"]//a/text () ')
For c in city:
Print (c)


CodePudding user response:

Big misunderstanding, I'm not just want to climb the province name, I want to click each provinces, then got take corresponding data, was climbing provinces stuck now, how to solve
  • Related