I am trying to scrape a webpage in python. I was able to easily get the results for tags which were on a single line, but for tags spread over multiple lines, my code cannot retrieve anything.
In the HTML source single line tags are present as:
<td><span class="facultyName">John Matthew Falletta, MD</span>
and multiple line tags are present as:
<td><span class="label">Division:</span>
</td><td>Hematology/Oncology</td>
Here is what I wrote:
patFinderFullname = re.compile('<span class="facultyName">(.*)</span>')
fullname = re.findall(patFinderFullname,webpage) #works fine
patFinderDivision = re.compile('<span class="label">Division:</span> </td><td>(.*)</td>')
division = re.findall(patFinderDivision,webpage) #doesn't work
Here my webpage variable contains the url which has to be scraped. Can someone point out, what I am missing, or where I am wrong?