MrGeezer 3 Posted May 16, 2013 Report Share Posted May 16, 2013 Hi guys, I have encountered a problem with a wildcard. Basically, I wish to match content between an <a></a> tag. The problem is that I need to add a wildcard when matching the tag. <h3><a class="name" href="/user/id=31266009&authToken=TRVU&locale=en_US&srchid=4852501813&srchindex=1">Name i want to scrape</a> eg (?<=</h3><a class="name" href="WILDCARDGOESHERE">)(.?*)(?=</a>) Is this possible? I tried inserting [a-zA-Z0-9\t\n .\/<>?;:"'`,!@#$%^&*()\[\]{}_+=|\\-] where WILDCARDGOESHERE exists, however this did not work Quote Link to post Share on other sites
blumi40 222 Posted May 16, 2013 Report Share Posted May 16, 2013 .{1,} Quote Link to post Share on other sites
MrGeezer 3 Posted May 16, 2013 Author Report Share Posted May 16, 2013 Hi Blumi, I appreciate your help, Not sure if I am implementing it incorrectly but it did not seem to work on my end? Basically, I need to locate the h3 tag, and a tag, but ignore anything in between the href as this differs from link to link, then scrape the content between the A tag Quote Link to post Share on other sites
Anonym 53 Posted May 16, 2013 Report Share Posted May 16, 2013 You don't need regexps for this. Just use scrape attribute and get the innertext. Quote Link to post Share on other sites
MrGeezer 3 Posted May 16, 2013 Author Report Share Posted May 16, 2013 Thanks Anonym, unfortunately in this case scrape attribute is not going to work as it was pulling out attributes that were irrelevant, i used scrape attribute to isolate the code above and need to regex it to refine it further. The other alternative i thought was to regex replace the entire <a*> tag.and then run another regex but this is probably not the most ideal way to do it Quote Link to post Share on other sites
Anonym 53 Posted May 16, 2013 Report Share Posted May 16, 2013 Can you pls show the site so that I can have a look at it?(if you are "afraid" of showing it in the public, then PM me. By the way, I am one of a few here who doesn't sell bots to small business owners or regular people. I primarily use it to automate my workday) 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.