从网站抓取数据(速率)
scrape data (rate) from website
我正试图从下面的网站上抓取这个汇率(“5.55”)并将其导入到 google 电子表格中。我努力尝试了很多次,只有 ERROS 作为答案出来了,我知道已经有关于它的问题。
网站:http://www.alphatransfers.co.uk/
我都试过了:
1) IMPORTXML(B3,/html[@class='js']/body[@class='home page page-id-55 page-template-default template-slider with_aside aside_right color-custom style-default layout-full-width header-modern sticky-header sticky-white subheader-title-left nice-scroll']/div[@id='Wrapper']/div[@id='Content']/div[@id='content_home']/div[@class='content_wrapper clearfix']/div[@class='sidebar sidebar-1 four columns']/div/form[@id='bottom_form'] /div[@class='mkt_strip'][2]/span[@id='mkt_rate_02'])
2) =IMPORTXML(B3,"//div[@class=`mkt_strip']|//div[@class='span_id']")
非常感谢。
为了获得纯值的基本目的,您要使用的公式是这样的:
=IMPORTXML("http://www.alphatransfers.co.uk/","//*[@id='mkt_rate_02']")
如果你想清理多余的 space 和冒号使用这个:
=SUBSTITUTE(IMPORTXML("http://www.alphatransfers.co.uk/","//*[@id='mkt_rate_02']"),": ","")
我正试图从下面的网站上抓取这个汇率(“5.55”)并将其导入到 google 电子表格中。我努力尝试了很多次,只有 ERROS 作为答案出来了,我知道已经有关于它的问题。
网站:http://www.alphatransfers.co.uk/
我都试过了:
1) IMPORTXML(B3,/html[@class='js']/body[@class='home page page-id-55 page-template-default template-slider with_aside aside_right color-custom style-default layout-full-width header-modern sticky-header sticky-white subheader-title-left nice-scroll']/div[@id='Wrapper']/div[@id='Content']/div[@id='content_home']/div[@class='content_wrapper clearfix']/div[@class='sidebar sidebar-1 four columns']/div/form[@id='bottom_form'] /div[@class='mkt_strip'][2]/span[@id='mkt_rate_02'])
2) =IMPORTXML(B3,"//div[@class=`mkt_strip']|//div[@class='span_id']")
非常感谢。
为了获得纯值的基本目的,您要使用的公式是这样的:
=IMPORTXML("http://www.alphatransfers.co.uk/","//*[@id='mkt_rate_02']")
如果你想清理多余的 space 和冒号使用这个:
=SUBSTITUTE(IMPORTXML("http://www.alphatransfers.co.uk/","//*[@id='mkt_rate_02']"),": ","")