How to search only the first x lines within an XML file
This post was updated on .
This being my first post, I'm sure I'll do something discordant with convention, so forgive me in advance.
Basically, I am trying to extract text from an html file using the CSS package in R. However, I am unable to do so because it seems that the text itself is not identified with any class and thus targeting it via the CSS function `cssApply` is difficult.
Now, considering that the text I want to extract is under the following Xpath (c&p from Chrome DevTool): /html/body/table/tbody/tr/td/table/tbody/tr/td/font/text()
Would the next move be to call the text from that path? If you need to see for yourself how the site's html is configured follow the link and use your respective browser's inspect element tool.
Any help would be appreciated. Thanks.
So I've decided to use the XML library within R and I'm now at a point where I can readily extract the desired data using the XML tags in the file. However, because the XML file repeats itself, the code currently outputs identical values as many times as the XML file is repeated - how can I search only the first, say, 10 lines of the XML file such that the desired value is output only once?