How can I get to the "phone" and "fax" using python in combination with css selector. I did select the "name" but in case of "phone" and "fax" I got stuck. Any help on this will be highly appreciated. Thanks in advance.
I tried with:
name = div.contact-details p #It works
phone = div.contact-details p #Can't think beyond
fax = div.contact-details p #Can't think beyond
Elements in which items are:
<div class="contact-details block dark">
<h3>Contact Details</h3><p>Company Name: PIMS Group Pty Ltd<br>Phone: +61 7
4969 3900<br>Fax: +61 7 4969 3999<br>Email: <a
href="mailto:admin@pims.net.au">admin@pims.net.au</a><br>Web: <a
target="_blank" href="http://www.pims.net.au">http://www.pims.net.au</a></p>
<h4>Address</h4><p>43 Evans Avenue<br>North Mackay<br>QLD<br>4740</p>
<h4>Contact</h4><p></p>
</div>
`. You could get the content of the `p` tag and parse it with regexes to get specific pieces of information – Andrew Che Jul 29 '17 at 19:52