Recently, I've been experimenting with web scraping data from different websites using selectorgadget in R. One successful example was when I extracted information from . My usual approach involves utilizing the selectorgadget Chrome extension to choose the tables I need and then inserting the CSS Selection outcome into my code like this:
urlx <- "http://www.dotabuff.com/heroes/abaddon/matchups"
rawData <- html_text(html_nodes(read_html(urlx),"td:nth-child(4) , td:nth-child(3), .cell-xlarge"))
When trying to extract data from , my selectorgadget query looked like this:
urlx <- "http://www.dotapicker.com/heroes/abaddon"
rawData <- html_text(html_nodes(read_html(urlx),".ng-scope:nth-child(1) .ng-scope .ng-binding"))
However, this time, no nodes were returned after calling the html_nodes function, resulting in:
{xml_nodeset (0)}
I suspect that the issue might be related to the structure of the table being nested within a drop-down box, unlike the previous scenario where the table was directly on the webpage. I'm currently exploring solutions to overcome this challenge.
Your assistance is greatly appreciated!