Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法获取标记,但它显示在html上_Html_Css_Web Scraping - Fatal编程技术网

无法获取标记,但它显示在html上

无法获取标记,但它显示在html上,html,css,web-scraping,Html,Css,Web Scraping,我正在尝试使用BeatifulSoup和find方法进行一项抓取工作,我使用lxml解析器获取HTML,如下所示: result = requests.get('https://wuzzuf.net/jobs/p/xgUqkfYngXZL-Senior-Python-Developer-Remote---Part-Time-Cairo-Egypt?o=2&l=sp&t=sj&a=python|search-v3|hpb') #print(result.status_c

我正在尝试使用BeatifulSoup和find方法进行一项抓取工作,我使用lxml解析器获取HTML,如下所示:

result  =  requests.get('https://wuzzuf.net/jobs/p/xgUqkfYngXZL-Senior-Python-Developer-Remote---Part-Time-Cairo-Egypt?o=2&l=sp&t=sj&a=python|search-v3|hpb')
#print(result.status_code)
soup1 =BeautifulSoup(result.content , "html5lib")
sections  = soup1.find( 'section' ,class_="css-3kx5e2")
divs = sections.find_all('div')
spans = sections.find_all('span')
span = divs[3].find('span' , class_ ='css-47jx3m')
divs[3]
我得到以下信息

<div class="css-rcl8e5"><span class="css-wn0avc">Salary<!-- -->:</span></div>
工资:
但是,原始HTML是

<div class="css-rcl8e5"><span class="css-wn0avc">Salary<!-- -->:</span>
<span class="css-47jx3m"><span class="css-8il94u">Confidential, Hourly Based</span>
</span>
</div>
工资:
机密的,按小时计算的
我需要获取('span class=“css-8il94u“'),其中包含文本('secretary,Hourly-Based'),但它没有出现


谢谢

“但是,原始HTML是”-不,不是。你必须在DOM inspector中查看该页面…在JS对其进行修改后。我检查该页面仍然需要使用我的代码获取工资值(机密,基于小时),因为它是一个动态网页,即javascript在加载后插入代码,因此你的解析器无法找到特定数据,您可以做的一件事是使用Selenium打开网页,然后在网页上搜索内容。参考:我收集了除此之外的所有数据,该站点不是动态站点,我同意您的意见,如果存在动态站点,数据将不会使用Beatifulsoup作为我的代码进行抓取,但该站点不是动态站点