[twill] frames & php

John Mudd johnbmudd at gmail.com
Tue Mar 21 14:13:53 PST 2006

Aw, shoot.  I just wanted to login to a SquirrelMail account and check
for new mail.  But as soon as I login this is the only HTML to work
with.  I guess this is another dead end for twill.  Too bad.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<meta name="robots" content="noindex,nofollow">
<title>xyz Labs</title>
</head><frameset cols="150, *" id="fs1">
<frame src="left_main.php" name="left" frameborder="1" />
<frame src="right_main.php" name="right" frameborder="1" />

Wait, I can jump directly to the left frame to at least see if there's
mail waiting for me.  No, I get the following error.  I was able to go
to 'https://www.xyzlabs.com/webmail/src/left_main.php' in the browser
after logging in.  But not in twill?  It tried to convert 'refresh' to
an int.  This must be because this page has a refresh built-in so that
it updates itself.

Traceback (most recent call last):
  File "./sqMailMon.py", line 17, in ?
  File "/usr/local/lib/python2.4/site-packages/twill-0.8.3-py2.4.egg/twill/commands.py",
line 95, in go
  File "/usr/local/lib/python2.4/site-packages/twill-0.8.3-py2.4.egg/twill/browser.py",
line 102, in go
    self._last_result = journey(self._browser.open, u)
  File "/usr/local/lib/python2.4/site-packages/twill-0.8.3-py2.4.egg/twill/utils.py",
line 70, in journey
    result.read() # HTML
  File "/usr/local/lib/python2.4/site-packages/twill-0.8.3-py2.4.egg/twill/utils.py",
line 33, in __init__
    self.http_code = int(http_code)
ValueError: invalid literal for int(): refresh

Here's the top of the HTML that I believe twill is trying to deal
with.  The word "REFRESH" appears at the end of this section.

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta name="robots" content="noindex,nofollow">
<meta http-equiv="Expires" content="Thu, 01 Dec 1994 16:00:00 GMT" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="REFRESH" content="300;URL=left_main.php" />

Here's the only other occurrence of "Refresh" in the HTML.  Is this a
problem for twill?

<small><span style="white-space: nowrap;">Last&nbsp;Refresh:</span><br
/><span style="white-space:
nowrap;">Tue,&nbsp;5:03&nbsp;pm</span></small><br /><small
style="white-space: nowrap;">(<a href="../src/left_main.php"
target="left">Check mail</a>)</small></td></tr></table><br /><span
style="white-space: nowrap;"><tt>&nbsp;&nbsp;</tt><a
target="right" style="text-decoration:none"><font
color="#770000">INBOX</font></a></span><br />


More information about the twill mailing list