我的python代码成功地从https://www.groupeactual.eu/offre-emploi中提取文本并将其保存在csv文件中
然而,有多个网页,在上面的网站上,我想能够刮
例如,对于上面的url,当我单击指向“第2页”的链接时,整个url都会更改,但当我在代码中使用该url时,我会从第1页获得结果
如何更改我的代码以从所有可用的列出页面中刮取数据
我的代码:
from bs4 import BeautifulSoup
import requests
import pandas as pd
response = requests.get('https://www.groupeactual.eu/offre-emploi').text
soup = BeautifulSoup(response, "html.parser")
[Rest of the code goes here .... ]
数据通过Ajax从不同的URL加载。此脚本遍历所有页面并打印每个页面的标题和链接:
印刷品:
相关问题 更多 >
编程相关推荐