【问题标题】:Trying to scrapy the link from website, in view page source cannot see it, but if I inspect one special item on page, it shows the href link试图从网站上抓取链接,在视图页面源中看不到它,但是如果我检查页面上的一个特殊项目,它会显示 href 链接
【发布时间】:2021-01-20 18:25:04
【问题描述】:

我正在播放的页面是 https://web.archive.org/web/*/https://cd.lianjia.com/,我想进入这个 webarchive 在不同时间点保存的页面,如日历中的点所示,但在查看页面源代码中我找不到任何 href 链接不同的时间点。如果我在一个时间点单击检查,我可以看到 href 链接在那里。 这是我的代码:

import re
from bs4 import BeautifulSoup
import requests
import urllib.request
url = 'https://web.archive.org/web/*/https://cd.lianjia.com/'
page = urllib.request.urlopen(url).read().decode('utf-8')
soup = BeautifulSoup(page, 'html.parser')

【问题讨论】:

    标签: python scrapy


    【解决方案1】:

    calendar grid 类下,您会发现一个标签层次结构,这些标签最终导致每个月每周的每一天。关联档案的日子将有一个calendar-day div 和关联的href

    【讨论】:

    • 感谢您的回复,尤其是我的问题看起来很难看。是的,当我检查特殊的日子时,我可以看到href链接,但是当我使用BeautifulSoup打开它时,所有与日历时间点相关的href都不在里面,我想用scrapy把这个链接都弄出来,接下来我该怎么办?
    • react-wayback-search 元素没有及时加载以获取漂亮的汤。这篇文章 (linked here) 可能对您有所帮助。
    猜你喜欢
    • 2012-02-18
    • 1970-01-01
    • 1970-01-01
    • 2015-09-13
    • 2019-01-14
    • 1970-01-01
    • 2017-08-30
    • 2012-01-18
    • 2021-05-11
    相关资源
    最近更新 更多