I have searched and I seem to be striking out.
Have a web page (well a bunch of them) that I am scraping - pulling together the permissions off of a Sharepoint site (WSS actually).
Am using Mechanize and TokeParser to scrape the main parts of the page. When it comes to testing for the icon and the underlying Javascript, these methods fail. So I found a section of HTML where the forward arrow would be located between two tags with unique classes. So I was going to grab the area between the tags and then test and extract the http address.
Source HTML:
.........<TD align=center Class="ms-vb" id="bottomPagingCell"><table><
+td nowrap class="ms-paging">1 - 100</td><td>
<A HREF="javascript:" OnClick='javascript:SubmitFormPost("
+http:\u002f\u002fwdcbeta.sharepointsite.net\u002f_layouts\u002fpeople
+.aspx?Paged=TRUE\u0026p_FSObjType=0\u0026p_Title=Michl\u002520Non\u00
+26p_ID=119\u0026View=\u00257b4B73D499\u00252dCD8D\u00252d4DE4\u00252d
+ABB5\u00252d1911503FA95C\u00257d\u0026FilterField1=ContentType\u0026F
+ilterValue1=Person\u0026MembershipGroupId=0\u0026PageFirstRow=101");j
+avascript:return false;'><img src="/_layouts/1033/images/next.gif" bo
+rder=0 alt="Next"></A></td></tr></table></TD></TR>
<TR><TD class="ms-bottompagingline3">.......
The code:
my $stream2 = $mech1->{content};
(my $stream_chunk) = $stream2 =~ /bottomPagingCell(.*)bottom/; # <----
+ fails here
if (/javascript:SubmitFormPost\(\"(.*)\"\)/)
{
mech1->get($1);
}
else
{
# no new page
}
It fails to find the first regex match. Seems like the quotes in the javascript is killing the match. Any suggestions?
Update: It is failing to find the section of HTML, part of which is above.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.