How login & download file from remote web site? Passwords a problem?

S

seberino

How make a Python script

1. login
2. type password &
3. download file

all from a **remote web site**?

I'm not comfortable with *MY* software handling the password part.

It just seems like trouble if users must tell *my* software their
password.

Is there a wise way to solve this or avoid this can of worms?

Chris
 
S

seberino

Gene

Thanks for links but I'm not sure what to do with them! The links were
about testing
frameworks. I just want to write a script to grab stuff from a remote
site (kinda like automatic ftp).

Perhaps those tests you were referring to have code to do what I'm
looking for?\

chris
 
S

Stuart Turner

How make a Python script

1. login
2. type password &
3. download file

all from a **remote web site**?

I'm not comfortable with *MY* software handling the password part.

It just seems like trouble if users must tell *my* software their
password.

Is there a wise way to solve this or avoid this can of worms?

Chris

Chris,

As a suggestion, why not look at the urllib and getpass modules.

If you get stuck, mail me and I'll send you over some sample code,

- Stuart
 
S

Steve Holden

Gene

Thanks for links but I'm not sure what to do with them! The links were
about testing
frameworks. I just want to write a script to grab stuff from a remote
site (kinda like automatic ftp).

Perhaps those tests you were referring to have code to do what I'm
looking for?\
I think the implication was that you'd need to do the appropriate
research to answer the question. However, if you want your software to
log into a web site on the user's behalf I don't really see that you
have much alternative than to ask them for the required information.

If you suspect they'll sue you for abuse of the data they enter, go find
another set of users ;-)

regards
Steve
 
S

seberino

Is it possible for users to just authenticate in another browser first?

i.e. If I authenticate from browswer X.....does EVERY web transaction
from SAME hostname have access **after**? How about just from
same user? same browswer? same process?

Chris
 
D

Dennis Lee Bieber

Is it possible for users to just authenticate in another browser first?

i.e. If I authenticate from browswer X.....does EVERY web transaction
from SAME hostname have access **after**? How about just from
same user? same browswer? same process?
Probably not... The authentication scheme likely returns a
session/timed cookie to the browser. That cookie would have to be
returned on each follow-up transaction (and possibly gets a new
expiration time on each use to avoid a time-out in the middle of slow
sequences).

The cookie may also limit access to those pages belonging to the
original user. Heck, I used to have to shut down my browser between
AmeriTrade(Datek) logins (I had three accounts at one time) because that
was the only way to clear out the cookie -- it wouldn't let me log into
any other account after the first.
--
 
C

calfdog

################################
# Quick and dirty script example

from win32com.client import DispatchEx
import time

def wait(ie):

while ie.Busy:
time.sleep(0.1)
while ie.Document.ReadyState != 'complete':

time.sleep(0.1)

#instaniate a new ie object so you can call it's methods and
properties...etc..
ie = DispatchEx('InternetExplorer.Application')

# You need to make it Visible
ie.Visible = 1

# Navigate to the page
ie.Navigate('mail.yahoo.com')

wait(ie) # important to wait for the doc to load


# Enter User info and submit the form since it uses submit
# If the button had a name attribute
# You could also use ie.Document.login_form.buttonName.Click

# ieObject.Document.FormName.TexboxName.value ="??"
ie.Document.login_form.username.value="MyName"
ie.Document.login_form.passwd.value="Mypasswd"
ie.Document.login_form.submit()


Enjoy
Rob M
http://pamie.sourceforge.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top