首页 文章
  • -3 votes
     answers
     views

    使用beautifulsoup抓取网站并获取文章文本

    从bs4导入BeautifulSoup导入请求 url =“https://www.premiumtimesng.com/category/news/top-news/page/2” response = requests.get(url)txt = response.text print(txt) soup = BeautifulSoup(txt,'html.parser')article = ...
  • 2 votes
     answers
     views

    使用Python刮擦多个页面仅重复第一页

    我正在试图 grab 这个页面https://www.anesishome.gr/%CE%B2%CF%81%CE%B5%CF%86%CE%B9%CE%BA%CE%AC-159#!/我需要前5页每个产品的名称和价格 . 问题是我的代码给出了第一页的结果5次 . 好像我没有改变下一页的网址 . 我究竟做错了什么?谢谢! from urllib.request import urlopen from b...
  • 1 votes
     answers
     views

    如何刮掉国际足联网站的javascripted表

    对于一个研究项目,我想从国际足联网站上搜集国际足球(足球)比赛的所有结果 . 我用R来做这个 . 但是,似乎包含匹配的表是使用javascript生成的 . 这是我想要的网址: http://www.fifa.com/live-scores/international-tournaments/fixtures-results/index.html#month5-2018 我尝试使用phantomj...
  • 1 votes
     answers
     views

    在Python中使用循环抓取多个页面

    我成功地 grab 了网站的第一页,但是当我试图抓取mutiples页面时,它起了作用,但结果却完全错了 . 码: import requests from bs4 import BeautifulSoup from urllib.parse import urljoin for num in range(1,15): res = requests.get('http://www.abcd...
  • 0 votes
     answers
     views

    在Python中刮“下一页”

    我想抓一个网页的下一页 . 它们总共20页 . 我想用第一页的网址抓下一页 . 码: b=[] url="https://abcde.com/cate6-%E7%BE%8E%E5%A6%9D%E4%BF%9D%E9%A4%8A/" res=requests.get(url) soup = BeautifulSoup(res.text,"lxml") b.ap...

热门问题