简体   繁体   English

使用 IMPORTXML 使用 Google 表格对纽约州账单进行网络抓取共同赞助商

[英]Web Scraping Co-Sponsors on NYS Bills using Google Sheets using IMPORTXML

I am currently trying to write a formula in Google Sheets so that it will take the co-sponsors for a NYS and put them into my google sheet.我目前正在尝试在 Google Sheets 中编写一个公式,以便它将纽约州的共同发起人放入我的 Google 表格中。 The formula that I wrote is:我写的公式是:

=IMPORTXML( https://nyassembly.gov/leg/?term=2021&bn=S01184 , "// [@id='legcontent']/table/tbody/tr[7]/td[2]"). =IMPORTXML( https://nyassembly.gov/leg/?term=2021&bn=S01184 , "// [@id='legcontent']/table/tbody/tr[7]/td[2]")。

//*[@id='legcontent']/table/tbody/tr[7]/td[2] is the xPath for the data that I am trying to extract which I copied from the HTML on the website. //*[@id='legcontent']/table/tbody/tr[7]/td[2] 是我试图从网站上的 HTML 中复制的数据的 xPath。

I am getting the error "Formula Parsing Error", however, I do not see where the error is.我收到错误“公式解析错误”,但是,我没有看到错误在哪里。 It would be much appreciated if anyone could help out!如果有人能帮忙,将不胜感激!

use:用:

=INDEX(IMPORTHTML("https://nyassembly.gov/leg/?term=2021&bn=S01184", 
 "table", 1), 7, 2)

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM