How to get HTML element that is before a certain class?
问题 I'm scraping and having trouble getting the element of the “th” tag that comes before the other “th” element that contains the “type2” class. I prefer to take it by identifying that it is the element "th" before the "th" with class "type2" because my HTML has a lot of "th" and that was the only difference I found between the tables. Using rvest or xml2 (or other R package), can I get this parent? The content which I want is "text_that_I_want". Thank you! <tr> <th class="array">text_that_I