google-sheetsweb-scrapinggoogle-sheets-formula

Scraping company names for my CRM but getting Formula Parse Error


Trying to scrape company names for my CRM (Google Sheets), but getting Formula Parse Error.

Screenshot of company names:

Website: https://exhibitormanual.oceanbusiness.com/

Tried to change child/class as a xpath quary parameter. Tried also IMPORTHTML.

Formula:
=importxml ("https://exhibitormanual.oceanbusiness.com/", "//*[@id="drts-platform-render-66fc2684827da-2-post-20696"]/div/div/div[2]/div[1]/a")


Solution

  • Here's one approach which pulls the 293 company names spread across 2 pages; some unwanted titles(top 11) are pulled as well. You can mess around with the code if you want a more targeted xpath:

    =reduce(tocol(,1),sequence(2),lambda(a,c,vstack(a,importxml("https://exhibitormanual.oceanbusiness.com/?_page="&c&"&num=200&sort=post_title","//*[@title]"))))
    

    enter image description here