a2mateit 395 Posted August 8, 2012 Report Share Posted August 8, 2012 Hi all, Been trying to figure this out on my own but I am stuck. What I am trying to do is remove everything before id in my list of urls. The list looks like this:http://ezinearticles.com/?UBot-Studio---The-Ultimate-in-Web-Automation?&id=3443164 http://ezinearticles.com/?Build-Your-Own-Software-for-SEO,-Is-It-Possible?&id=6411746 What I am needing to do is remove everything before ?&id= and leave the list looking like this:?&id=3443164 ?&id=6411746 Or even:3443164 6411746 Any help would be greatly appreciated. Thanks,Justin Quote Link to post Share on other sites
a2mateit 395 Posted August 8, 2012 Author Report Share Posted August 8, 2012 I have dug around a little bit and this: ^.*?= is supposed to get rid of everything before the =. I just don't know how to implement it in my list to clean all the urls. Quote Link to post Share on other sites
k1lv9h 76 Posted August 8, 2012 Report Share Posted August 8, 2012 Hi, Sample code:set(#urld, "http://ezinearticles.com/?UBot-Studio---The-Ultimate-in-Web-Automation?&id=3443164 http://ezinearticles.com/?Build-Your-Own-Software-for-SEO,-Is-It-Possible?&id=6411746", "Global") clear list(%urls) add list to list(%urls, $list from text(#urld, $new line), "Delete", "Global") loop($list total(%urls)) { if($comparison($list position(%urls), "<", $list total(%urls))) { then { set(#urlitem, $next list item(%urls), "Global") set(#urlitemid, $replace regular expression(#urlitem, ".*&id=", $nothing), "Global") } else { } } }sample-return-id-001.ubot Kevin 2 Quote Link to post Share on other sites
a2mateit 395 Posted August 8, 2012 Author Report Share Posted August 8, 2012 Thanks Kevin, Is there any chance I can remove everything before the "=" while scraping from google? This is the code I am using to scrape from google:add list to list(%urls, $scrape attribute(<class="l">, "href"), "Delete", "Global") It would really be awesome if you could help me figure that out. Thanks,Justin Quote Link to post Share on other sites
a2mateit 395 Posted August 8, 2012 Author Report Share Posted August 8, 2012 Nevermind, I got it figured out. Thank you kevin! Quote Link to post Share on other sites
jomark3 25 Posted August 9, 2012 Report Share Posted August 9, 2012 using regex:([0-9]{7})pulls up just the id number 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.