Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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?

Replies are listed 'Best First'.
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?
[Corion]: Mhmm. I'm writing a database export, and two supposedly identical files compress to different sizes... So either the order of rows is different (which would be OK) or something else is bad (which wouldn't be OK). I guess I have to test with smaller tables

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2018-04-25 07:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?