0
votes

I'm trying to Import a table from "https://www.ebay.com/itm/100-NEW-ALTERNATOR-VW-GOLF-GTI-GL-GLS-1-8T-1-8-2L-99-06-90A-1-YR-WARRANTY-13852/301364941754?fits=Model%3AJetta&hash=item462ac013ba:g:v7oAAOSw~YRagU4N&vxp=mtr" to a Google Spread sheet using =IMPORTXML function, The Formula I was using as below,

A1 = https://www.ebay.com/itm/100-NEW-ALTERNATOR-VW-GOLF-GTI-GL-GLS-1-8T-1-8-2L-99-06-90A-1-YR-WARRANTY-13852/301364941754?fits=Model%3AJetta&hash=item462ac013ba:g:v7oAAOSw~YRagU4N&vxp=mtr

A2 = //*[@id="w1-20ctbl"]

A3 = =IMPORTXML(A1,A2)

But it returns nothing and It says "Imported content is empty."

Can Somebody help me, I'm new to google sheet scripting and I'll really grateful if somebody can help me.

waiting to hearing from somebody....

Thanks

1
There is no element on that page with the id "w1-20ctbl"Diego
Thanks @Diego, Can you please tell me how to get the Xpath to that table. There is only one table in that Url pageuser9614426
I don't know what table you're referring toDiego
@Diego, There is one table in that page, table headings are Notes,Year Make,Model,Trim Engineuser9614426
I took the Xpath inspecting the web page on google cromeuser9614426

1 Answers

1
votes

You cannot access the pictured table using IMPORTXML or any built-in Google Sheets formula because the table is generated when a user visits the website.

enter image description here

If you look at the page source, you'll see that the table does not exist. IMPORTPATH looks at this page source, which is the content before javascript rendering by the browser. When you "inspect" an element in your browser, it's inspecting the content after the javascript has been rendered.

Unfortunately, there is not a simple way to get the data you're looking for. You'll have to find or build your own scraping tool. Be careful not to violate eBay terms of use or any local laws.