Hello I am trying to scrape some data from a website that has data in its 'dl' tag here is how the website structure looks
<div class="ecord-overview col-md-5">
<h2><span itemprop="name">Donald Duck</span></h2>
dl class="row">
</dd>
<dt class="col-md-4">Email</dt>
<dd class="col-md-8">myemail.com</dd>
</dl>
<div class="ecord-overview col-md-5">
<h2><span itemprop="name">Mickey mouse</span></h2>
dl class="row">
</dd>
<dt class="col-md-4">Email</dt>
<dd class="col-md-8">youremail.com</dd>
</dl>
... data goes on but value differs
To scrape this i am using selenium:
my code for scraping
for element in driver.find_elements_by_class_name('ThatsThem-record-overview'): # here im scraping name
#print(Style.RESET_ALL)
print(Fore.RED + element.text + Style.RESET_ALL)
#print(Style.RESET_ALL)
time.sleep(1)
dl= driver.find_element_by_tag_name('dl') # scraping data under dl tag
print(dl.text)
print('-----------------------')# seperator
So what is happening that whenever i execute the program it prints the dl stuff same for every name and data like this
donald duck
Email
myemail.com
-------------
mickey mouse
Email
myemail.com
I have already tried putting dl
in for loop the same way i am doing to print name but it prints other things as well that i don't want
what can i do?