0

How do we scrape the text of a below div tag using goquery

<div class="class_1" attr="attr_1">text</div>

I tried with the below selection logic, but it didn't work

divtag := doc.Find("div[class='class_1' attr='attr_1']")

I couldn't find example for goquery selection based on multiple attributes as above. Does goquery provide such functionality? How should we scrape it?

vignesh
  • 498
  • 8
  • 18

1 Answers1

0

It was a syntax issue on selection, the below selection worked.

divtag := doc.Find("div[class='class_1'][attr='attr_1']")

vignesh
  • 498
  • 8
  • 18