Buckethead 1 Posted August 24, 2013 Report Share Posted August 24, 2013 I'm trying to scrape the href urls from a page, however so far I've been unsuccessful... The page has different peoples names on it, with each of their names containing a link to their profile. This is the code that contains the hreflink (the person name contains the URL that i want to scrape <li class="clickable"><input type="hidden" id="quick_follow_username_15768" value="MathewPeter"><input type="hidden" id="quick_follow_name_15768" value="Mathew Peter"><div class="image-container"><a href="Mathew Peter"><img src="http://img.com" alt="Mathew Peter" ></a> I want to grab the hyperlink that is bolded with the persons name above... do I have to use regex to do this? (havent got much experience) any help would be most welcome, cheers Quote Link to post Share on other sites
Pete 121 Posted August 24, 2013 Report Share Posted August 24, 2013 add list to list(%Names1, $list from text($page scrape("<div class=\"image-container\"> <a href=\"", "\"> <img"), $new line), "Delete", "Global") add list to list(%Names2, $list from text($scrape attribute(<href=w"*">, "fullsrc"), $new line), "Delete", "Global") add list to list(%Names3, $list from text($scrape attribute(<href=w"*">, "href"), $new line), "Delete", "Global") Quote Link to post Share on other sites
Buckethead 1 Posted August 24, 2013 Author Report Share Posted August 24, 2013 add list to list(%Names1, $list from text($page scrape("<div class=\"image-container\"> <a href=\"", "\"> <img"), $new line), "Delete", "Global") add list to list(%Names2, $list from text($scrape attribute(<href=w"*">, "fullsrc"), $new line), "Delete", "Global") add list to list(%Names3, $list from text($scrape attribute(<href=w"*">, "href"), $new line), "Delete", "Global") That pulled every url (including .css links/outbound/inbound unrelated links from the page... here is some more source code from the page that could help? Once again, the href="kelvin.hos" (the underline) is the only type of links that I want to scrape <div class="details bold"> <a class="clickable-target" href="kelvin.hos"> <h4 class="orange">Kelvin Hos</h4> </a> Quote Link to post Share on other sites
Pete 121 Posted August 24, 2013 Report Share Posted August 24, 2013 Sounds like you need to post the page url or this could go on a long time working with code snippets Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.