Reputation: 2927
I'm scraping a site that has a number of divs with the same ".pane" class and same "data-pane" data attributes.
input = doc.css('.pane[data-pane]')
How do I filter or select from the above to get the div which has a "data-pane" attribute equal to a specific value?
Upvotes: 1
Views: 2732
Reputation: 79723
You can just treat it as you would any other attribute with the usual CSS syntax:
input = doc.css('.pane[data-pane="the value"]')
Upvotes: 4