Hello,
I have the following scraping task for this webpage:
- click on the company’s name to access its “detail” page
- store the company’s website as a csv line
- go back to the “list” page of all companies
- repeat for all companies (approx. 15,000)
(Unfortunately, you will need to create a free account in order to have access to the full list of companies)
The following (very simple) script works properly for the first 4 companies and then breaks:
“Name”: “FrenchTech2”,
“CreationDate”: “2020-5-4”,
“Commands”: [
{
“Command”: “open”,
“Target”: “https://ecosystem.lafrenchtech.com/companies.startups/f/launch_year_min/anyof_2015/locations/allof_France?showGrid=true”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “xpath=//[@id="list-map-list"]/div/div/div[1]/div[${!loop}]/div/section/div/div[1]/a/h3",
“Value”: “”
},
{
“Command”: “storeText”,
“Target”: "xpath=//[@id="window-scrollbar"]/div[1]/main/div/div/section/div/div/div[2]/div[2]/div[3]/a”,
“Value”: “!csvLine”
},
{
“Command”: “csvSave”,
“Target”: “url6”,
“Value”: “”
}
]
}
This is due to the fact that the element “xpath=//*[@id="list-map-list"]/div/div/div[1]/div[${!loop}]/div/section/div/div[1]/a/h3” (which allows access to the detail page for each company) is unstable for each company: every time I scroll up or down, the number in the 4th “div” (which is the relevant variable - cf. !loop) changes.
Can someone help with this? I was thinking that perhaps using the XClick or XMove commands could help but I have not managed to make the macro work.
Thanks a lot for your help!