Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: WWW::Mechanize - how to get the position of an element on my screen?

by Anonymous Monk
on Jan 31, 2012 at 19:01 UTC ( #951043=note: print w/ replies, xml ) Need Help??


in reply to WWW::Mechanize - how to get the position of an element on my screen?

http://stackoverflow.com/questions/442404/dynamically-retrieve-html-element-x-y-position-with-javascript


Comment on Re: WWW::Mechanize - how to get the position of an element on my screen?
Re^2: WWW::Mechanize - how to get the position of an element on my screen?
by mascip (Pilgrim) on Jan 31, 2012 at 19:18 UTC

    This is a Javascript solution to get the position of an Element, by retrieving it with its ID.
    It doesn't really answer my question, because the element whose position i want has no ID.
    One could say "use getElementsByTagName, then!" .
    It wouldn't do either : i don't want to have to search my element with Javascript tools.

    I have ALREADY found the element i'm interested in with HTML::Tree, and want to get it's position.
    I could do with Javascript tools if there's no Perl module that gets it for me, but then i'd need to tell Javascript who my element is. I don't know how to do this.

    Thanks for very fast answer, though =o)

      You don't seem to understand. The "position" of an HTML element only exists if the HTML is actually rendered into a layout. HTML::Tree does not do such rendering.

        That's an important point and i didn't know it, thank you Corion.

        Would it then be possible for me to pass my HTML::Element to Javascript? Does it make any sense?

        My aim being : finding the element with HTML::Tree, and then retrieving its position with Javascript.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://951043]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2014-09-22 23:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (208 votes), past polls