Suppose I have a variable called $html which contains an entire webpage worth of HTML code. What I want to do is look for this: <div class="foo">bar</div> HTML: And extract "bar" only from the entire string. There is only 1 div statement that uses that specific class in the entire html code. Can somebody point me in the right direction here? I suck at perl regex'ing
I don't have any knowledge about regexp, but if you have the willingness to use id instead of class regarding to the unique div you may use the document.getElementByid('foo').value javascript function to grab the contained character string. Thanks
Can't use javascript I'm afraid. The content is on a third party website, this is essentially scraping a tiny piece of something off one of their pages. I can't inject JS code into their pages to run something like that, and I need the result stored in Perl for some other code that is run.