login about faq

I am trying to automate a login to a site which uses Javascript popups for its login. Apparently I cannot do so using cURL. Is this really the case? Can cURL communicate with Javascript? Or is not doable?

Thanks.

asked Jan 30 '10 at 09:55

Paolo%201's gravatar image

Paolo 1
412

edited Jan 31 '10 at 23:42

radamanthus's gravatar image

radamanthus
1.1k110


The site login will most likely still use HTTP POST to send the user credentials to the server even if the entry method is a Javascript popup. My suggestion would be to either use a packet sniffer like Wireshark or reverse engineer the script to determine the login server and parameters sent so that you could setup cURL to login.

From there, you could parse the body or get the cookies from the response to check if the login was successful.

link

answered Jan 30 '10 at 13:28

Bryan%20Bibat's gravatar image

Bryan Bibat
2.6k119

Why not use Selenium Remote Control? You can automate it using your favorite language: Java, Ruby, Python, and possibly others.

link

answered Jan 31 '10 at 23:44

radamanthus's gravatar image

radamanthus
1.1k110

Somewhat like datenshi's suggestion you could install firebug and look at the request headers etc at the Net tab of the firebug console.

link

answered Feb 01 '10 at 06:05

AnGoL's gravatar image

AnGoL
1.3k318

THanks guys! I'll try your suggestions

link

answered Feb 01 '10 at 07:24

user-37%20%28google%29's gravatar image

user-37 (google)
412

For responses like these, avoid posting them as answers, but as comments instead.

(Feb 01 '10 at 12:45) Nikki Erwin Ramirez ♦♦ Nikki%20Erwin%20Ramirez's gravatar image

I used firebug to trace the headers and post data and it worked! Thanks again.

link

answered Feb 01 '10 at 08:45

user-37%20%28google%29's gravatar image

user-37 (google)
412

For responses like these, avoid posting them as answers, but as comments instead.

(Feb 01 '10 at 12:45) Nikki Erwin Ramirez ♦♦ Nikki%20Erwin%20Ramirez's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×63
×18
×3
×1

Asked: Jan 30 '10 at 09:55

Seen: 1,718 times

Last updated: Feb 01 '10 at 08:45