-1
[<input class="mail opentip" 
        data-original-title="Your temporary Email address" 
        data-placement="bottom" 
        id="mail" 
        onclick="select(this);" 
        readonly="" 
        title="" 
        type="text" 
        value="wukur@storj99.com"/>]

How can I extract using beautifulsoup the email : "wukur@storj99.com"

cs95
  • 379,657
  • 97
  • 704
  • 746
Elie
  • 1
  • 1
  • 2
    Possible duplicate of [Extracting an attribute value with beautifulsoup](https://stackoverflow.com/questions/2612548/extracting-an-attribute-value-with-beautifulsoup) – kristaps Jul 24 '17 at 10:10
  • Use: `soup.find('input', {'id':'mail'}).get('value')` – t.m.adam Jul 24 '17 at 11:08

1 Answers1

0

you could use this:

from bs4 import BeautifulSoup
text = '''<input class="mail opentip" data-original-title="Your temporary Email address" data-placement="bottom" id="mail" onclick="select(this);" readonly="" title="" type="text" value="wukur@storj99.com"/>'''

parse = BeautifulSoup(text, 'lxml')

for z in parse.find_all('input', {'class':"mail opentip"}):
    print(z['value'])
0xMH
  • 1,825
  • 20
  • 26