Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^6: WWW::Mechanize::Chrome Instagram

by damian1 (Novice)
on Sep 08, 2019 at 12:56 UTC ( [id://11105834]=note: print w/replies, xml ) Need Help??


in reply to Re^5: WWW::Mechanize::Chrome Instagram
in thread WWW::Mechanize::Chrome Instagram

Can you show my example? I find function sendkeys() but i don't find example uses for two input, and i don't find enter key code

Replies are listed 'Best First'.
Re^7: WWW::Mechanize::Chrome Instagram
by Corion (Patriarch) on Sep 08, 2019 at 13:12 UTC

    To enter input into any input field, focus the input field by ->click()ing it, and then send keys.

    Also, I assume that you can switch input fields by using the \t tab key.

      I try but not work, it still doesn't detect and the button is blocked, in addition as I display the content after filling it is empty

      $mech->click({xpath => '//input[@name="username"]', single => +1 }); $mech->sendkeys( string => $user ); $mech->click({xpath => '//input[@name="password"]', single => +1 }); $mech->sendkeys( string => $pass ); $mech->sleep(1); $mech->click({intrapage => 1, text => 'Log In', single => 1 }) +; $mech->sleep(2); print $mech->content;

        Without seeing the HTML and Javascript, it's hard to know what the page does wrong so that clicking in the form fields get filled but the button does not get unblocked.

        If by "the content is empty" you mean that the input you type is not visible in the form fields, then either that does not work or you are not clicking on the correct fields.

        You can indirectly watch your browser as it progresses by using the screencast feature. See Mojolicious::Plugin::PNGCast for something that will display a window of your headless browser page.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-03-29 12:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found