Enigma 78 Posted November 2, 2012 Report Share Posted November 2, 2012 I tried a few things but can't get it to work. What i want to do is loading a page, then using a regular expression that scrapes a particular strings (let's say phone number for example) and add that to a list. I need to scrape this way, because $scrape page or $scrape attribute is not possible on this particular site. So what i want is the webpage loads, it checks whether a particular string is present anywhere on the page, if yes then scrape that string and add it to a list. Quote Link to post Share on other sites
k1lv9h 76 Posted November 2, 2012 Report Share Posted November 2, 2012 Hi, Some sample html webpage code to work with would help. Kevin Quote Link to post Share on other sites
VaultBoss 310 Posted November 2, 2012 Report Share Posted November 2, 2012 [...] because $scrape page or $scrape attribute is not possible on this particular site. Now you made me curious! Why is that?Can you share the website URL?.. Let's take a look! Quote Link to post Share on other sites
HelloInsomnia 1103 Posted November 2, 2012 Report Share Posted November 2, 2012 Without knowing the string we can't give you the regex. Phone numbers can be listed in different ways and each way can give a different regex. I'm still learning regex but I'll give it a crack if you post the string you need to find. Quote Link to post Share on other sites
Enigma 78 Posted November 2, 2012 Author Report Share Posted November 2, 2012 Thanks for the replies, i already have the regex and the site remains private, but i only wanted to know how to use it with scraping a webpage like mentioned in post #1. The bot loads a webpage then runs the regex to scrape if anything meets that regex. Quote Link to post Share on other sites
merkaba 36 Posted November 2, 2012 Report Share Posted November 2, 2012 Not exactly the way you probably want to do it, but this is the only way I've been able to do it set(#var, $page scrape("<html", "</html>"), "Global") clear list(%test) add list to list(%test, $find regular expression(#var, "your regex"), "Delete", "Global") if($comparison($list total(%test), ">", 0)) { then { alert("yup") } else { alert("no") } } 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.