I am trying to analyze an HTML document to determine the elements that are the visually widest elements. I want to visit each node on the page and determine its width, using the element_coordinates method. The method takes a css selector as an argument. So I'm looking for a way to generate css selectors for each node, similar to the way the developer tools in browser's do that.
First question is, can this be done through Mechanize::Chome over port 9222? I'm guessing I would need to learn how to send queries directly through the $mech object over the transport layer. If this is possible, any details would be appreciated.
If that won't work, how can I generate a unique css selector for each node. My initial thought process was:
Any help is appreciated. Thanks.
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
In reply to How to process each node in an HTML page by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |