0

For example:

div data3456 = "some value"

data3456 is a custom attribute for the div. How can I scan the html looking for "data3456" and find "some value"?

Stu Furlong
  • 3,490
  • 5
  • 34
  • 47

1 Answers1

0

You can use similar logic which is used here: How to use CSS selectors to retrieve specific links lying in some class using BeautifulSoup? .

Try this:

for el in upcoming_events_div.select('div[data3456]'):
    print el['data3456']
Khalid Khan
  • 3,017
  • 1
  • 11
  • 27
Marsilinou Zaky
  • 1,038
  • 7
  • 17