shahin
Active Member
Hi there! I've made a parser which is pulling e-mail but it is crude. I've refined it already but the code looks messy. Is it the right way I'm doing or any better solution? Thanks in advance.
Crude One: mailto:ben%40holysmokesbbq.com.au?subject=Enquiry%2C%20sent%20from%20yellowpages.com.au&body=%0A%0A%0A%0A%0A------------------------------------------%0AEnquiry%20via%20yellowpages.com.au%0Ahttps%3A%2F%2Fwww.yellowpages.com.au%2Fvic%2Fballarat-central%2Fholy-smokes-barbecue-1000001786433-listing.html%3Fcontext%3DbusinessTypeSearch%26isTopOfList%3Dtrue%26premiumProductId%3D400005055323
Refined One: ben@holysmokesbbq.com.au
Here is the code:
Crude One: mailto:ben%40holysmokesbbq.com.au?subject=Enquiry%2C%20sent%20from%20yellowpages.com.au&body=%0A%0A%0A%0A%0A------------------------------------------%0AEnquiry%20via%20yellowpages.com.au%0Ahttps%3A%2F%2Fwww.yellowpages.com.au%2Fvic%2Fballarat-central%2Fholy-smokes-barbecue-1000001786433-listing.html%3Fcontext%3DbusinessTypeSearch%26isTopOfList%3Dtrue%26premiumProductId%3D400005055323
Refined One: ben@holysmokesbbq.com.au
Here is the code:
Code:
Set topics = html.getElementsByClassName("contact contact-main contact-email")
For Each topic In topics
On Error Resume Next
v = Split(topic.href, "?")
Cells(x, 1) = Replace(Replace(v(LBound(v)), "mailto:", ""), "%40", "@")
x = x + 1
Next topic