【问题标题】:google sheet importxml to scrape seekingalpha news谷歌表 importxml 来抓取 seekalpha 新闻
【发布时间】:2020-09-08 09:57:20
【问题描述】:

长期以来,我一直在使用 google sheet importxml 来抓取 seekalpha。最近我发现很难搜索到 alpha 新闻。

例如从“https://seekingalpha.com/news/3611919-epic-makes-another-attempt-reversing-fortnite-app-store-ban”抓取新闻 我使用以下公式:

=JOIN(CHAR(13), importxml("https://seekingalpha.com/news/3611919-epic-makes-another-attempt-reversing-fortnite-app-store-ban","//div[@id='bullets_ul']"))

大多数时候会报错:could not fetch url.

过去,我可以在 url 中添加“#1234”或其他数字来“强制”再次下载。但最近似乎不起作用。

知道如何使新闻下载更可靠吗?

【问题讨论】:

    标签: xml google-sheets import google-sheets-formula


    【解决方案1】:

    您正在寻找一种强制刷新 IMPORTXML 的方法。似乎没有为此的键盘快捷键,因此您可以为您find an apps-script to do that,或者这样做。 (我敢肯定还有其他方法可以做到。)

    1. 在某个单元格中添加一个复选框(此处为 B1)
    2. 使用这个:
    =JOIN(,importxml(REPT(" ",B1)&"https://seekingalpha.com/news/3611919-epic-makes-another-attempt-reversing-fortnite-app-store-ban","//div[@id='bullets_ul']"))
    

    通过更改 URL,导入会刷新,所以当我们取消选中或选中该框时,REPT 在 URL 前附加 0 或 1 个空格。

    不,我们不能使用任何函数,例如RAND()(或任何相关函数)或NOW()

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-27
      • 2022-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多