Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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]: Discipulus: I'm slowly migrating my code to require 5.8.x ;) Most of my code works on 5.6, but Filter::signatures requires 5.10 I think
[Corion]: 5.14 is also a good target, widely available and fairly stable. Also, over five years old, which doesn't push people into a needless upgrade cycle
[Discipulus]: yes I saw your efforts Corion but the pain is worth?
[Corion]: Discipulus: IMO it's not that much pain, but most of the systems I use have a Perl 5.14 or newer on them nowadays
[marto]: the question is more, is Padre still the way new users should be directed?
[Discipulus]: ah ah I have all 5.26 atm but I play alone..
[Corion]: Except this RHEL box, which comes with Perl 5.10.1 , but there I installed my own 5.20.3 for the real Perl programs we run ;)
[Corion]: marto: I used Padre for some time but then switched to Notepad++, since all the funky features I wanted to put into Padre couldn't be made to work, and/or I lost interest :)
[Discipulus]: indeed marto I dunno. I tested once and many years ago. But I'm not the programmer yardstick. I try to install Padre via cpan now just to add a line about it in the issue. Strawberryperl all life long!
[marto]: yeah, when I worked on Windows I did use Np++ all the time

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (11)
As of 2018-06-25 08:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (126 votes). Check out past polls.

    Notices?