User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 426,811 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,894 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser: Programming Forums
Views: 441 | Replies: 2
Reply
Join Date: Jun 2008
Posts: 2
Reputation: aditi1184 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
aditi1184's Avatar
aditi1184 aditi1184 is offline Offline
Newbie Poster

Twill - using 'find' command from python code

  #1  
Jun 27th, 2008
Hi,

I am trying to use the 'find' command of twill from within a python code but it seems to return no result. I tried to run that command on the command prompt by running twill and it works fine. But when I try to run the same command from a python code, it returns 'None' as result.

My code is as follows:

-- trial.py--
from twill.commands import *
from twill import commands

go('http://www.gmail.com/')
showforms()
print find("Email")
This returns 'None' on the command prompt when I run trial.py from the command prompt.

Any help or suggestions will be very helpful. Thank you.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2006
Posts: 447
Reputation: woooee is on a distinguished road 
Rep Power: 2
Solved Threads: 62
woooee woooee is offline Offline
Posting Pro in Training

Re: Twill - using 'find' command from python code

  #2  
Jun 27th, 2008
I know nothing about twill, but find "EMail" in what? You would also have to give it a file name or a string, etc. to search in. You would want to tell it if you want a search or a match as well. Looks like Google time. Also, see if Twill has a forum or mailing list that you can search.
Reply With Quote  
Join Date: Jun 2008
Posts: 2
Reputation: aditi1184 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
aditi1184's Avatar
aditi1184 aditi1184 is offline Offline
Newbie Poster

Re: Twill - using 'find' command from python code

  #3  
Jul 17th, 2008
Hi,

I encountered another problem while using twill from command prompt. I have a website which uses a "check_password" page to check the user password entered for login. If the password is correct, the user is automatically redirected to the home page of the site. This works fine in any standard browser, IE, Firefox, Opera... But while using twill, twill stops at the "check_password" page. This page contains no forms, no links, nothing. It just includes some javascript files and calls a function which is used for redirecting the browser. I dont have the source code for the javascript files. I know that a javascript function is called because of the "show" command that I used from twill command prompt, which showed the html of the current "check_password" page.

I checked with another site that used such "check_password" page and twill stopped at that page too. I dont have the source codes for these sites. I am simply using twill as a text browser to view them.

Any workarounds for such a problem ?
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Python Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the Python Forum

All times are GMT -4. The time now is 8:00 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC