BaiduSpider / BaiduSpider

BaiduSpider,一个爬取百度搜索结果的爬虫,目前支持百度网页搜索,百度图片搜索,百度知道搜索,百度视频搜索,百度资讯搜索,百度文库搜索,百度经验搜索和百度百科搜索。

Home Page:https://baiduspider.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG]search_web()返回为空

380355757 opened this issue · comments

描述该问题

baiduspider\parser_init_.py
image
百度的源码是不是已经变了 匹配不到数据 srcid的值 每次搜索都会变
image

.....或者是我菜...

复现该问题

请提供能够复现该问题的代码或步骤。

预期结果

一个对你想要的结果的清晰的描述。

实际结果

你实际得到的结果。

系统

  • 操作系统: 例如:MacOS
  • Python版本: 例如:3.8

其他描述

一些关于问题的其他的描述。

已解决

怎么解决的 请教?

怎么解决的 请教?

已解决

image
def parse_webpage_block(self, news:BeautifulSoup) -> Dict:

    webpage_rows = news.find_all("div",class_="c-container",tpl="se_com_default")
    webpage_detail = []
    # print(len(webpage_rows))
    for row in webpage_rows:
        #
        # print(row)
        # print('________________________________________________________')
        row_title = self._format(row.find("h3",class_="t").find("a").text)
        descr =self._format(row.find("span",class_="content-right_8Zs40").text)
        row_url =self._format(row.find("h3",class_="t").find("a")["href"])

        # print(row_title,descr,row_url)
        webpage_detail.append(
            {
                "titl":row_title,
                "url":row_url,
                "descr":descr,
            }
        )
    return webpage_detail