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,297
  • 5
  • 37
  • 45

2 Answers2

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
  • 2,640
  • 1
  • 11
  • 23
Marsilinou Zaky
  • 1,028
  • 6
  • 17
0

May I suggest this article? It covers, what I think, you are looking for.