Hello
I'm new here, but I need some help. I'm trying to do a login into the safilo website ( http://www.safilonet.safilo.com/) running python code.
There is an error that I'm not capable to find where it is:
---------- run.py -
"""UPDATE SAFILO"""
-
-
ss = SafiloSupplier(updateBrands=True)
-
-
#ss.resetLog()
-
#ss.printBrands()
-
-
brds = ss._brands
-
-
start_at_brand = ''
-
print 'Brands before filtering:', len(brds)
-
if len(start_at_brand) > 0:
-
while len(brds) > 0 and brds[0]._ref != start_at_brand:
-
brds.pop(0)
-
print 'Brands after filtering:', len(brds)
-
#sys.exit(0)
-
-
#ss.clearAllModelFromSql()
-
-
for b in brds:
-
ss.addToLog('** BRAND %s... **' % b._ref, True)
-
-
print '*** Updating catalog... ***'
-
ss.updateCatalog(b._ref)
-
-
print '*** Expanding models... ***'
-
ss.expandModels(b._ref)
-
-
----------- Supplier.py
-
-
class SafiloSupplier(Supplier):
-
'''
-
100% faulty HTML webscrapping client for Safilo supplier.
-
Uses hand-made MiniTidy class for converting HTML to valid XML for further parsing.
-
'''
-
-
def __init__(self, updateBrands=False, login=True):
-
Supplier.__init__(self)
-
-
self._name = 'Safilo'
-
self._username = '******'
-
self._password = '******'
-
self._baseUrl = 'http://www.safilonet.safilo.com'
-
self._ignoreBrandsWithRef = ['BLU', 'SAF']
-
self._root += 'safilo\\'
-
self._brandsPC = PersistLite(instance=Brand(), path=self._root + 'brands\\brands.sqlite')
-
self.last_logged_in = None
-
-
if login: self.login()
-
-
if updateBrands:
-
self.updateBrands() # also saves
-
else:
-
self.loadBrands()
-
-
self.filterBrands()
-
-
-
def check_login(self):
-
n = datetime.datetime.now()
-
dt = n - self.last_logged_in
-
if dt.seconds > 120:
-
print 'Logged in for %d seconds. Logging in again...' % dt.seconds
-
self.login()
-
-
##webapp/commerce/safilo/jsp/logon.jsp
-
-
def login(self):
-
url = self._baseUrl + '/webapp/commerce/logon'
-
self._br.open(url, timeout=30.0)
-
self._br.select_form('logon')
-
self._br.form['login'] = self._username
-
self._br.form['password'] = self._password
-
self._br.submit()
-
-
if self._verbose: print 'Login successful.\n'
-
-
self.last_logged_in = datetime.datetime.now()
-
-
There is more code in both files, but i think the error is somewhere on this peace of code.
-
-
The error presented is:
-
-
Traceback (most recent call last):
-
File "E:\billy\Projects\GlassInteg\trunk\src\run.py", line 89, in <module>
-
go()
-
File "E:\billy\Projects\GlassInteg\trunk\src\run.py", line 39, in go
-
ss = SafiloSupplier(updateBrands=True)
-
File "E:\billy\Projects\GlassInteg\trunk\src\GlassInteg\Supplier.py", line 280, in __init__
-
if login: self.login()
-
File "E:\billy\Projects\GlassInteg\trunk\src\GlassInteg\Supplier.py", line 302, in login
-
self._br.select_form('logon')
-
File "build\bdist.win32\egg\mechanize\_mechanize.py", line 524, in select_form
-
mechanize._mechanize.FormNotFoundError: no form matching name 'logon'
Can you please help me?
5 2695
It would help to know what that error message is.
@Rabbit The error message is on the line 82. I haven't still solved this problem! I can't understand what's going on...
It sounds like a pretty clear error message. There's no form on that page named logon.
There is a form named logon,
Take a look at this source code: - <form action="https://www.safilonet.safilo.com/webapp/commerce/logon" method="post" target="_top" name="logon" onsubmit="return checkFields();" enctype="application/x-www-form-urlencoded">
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Bill Clark |
last post by:
I just had MS Access 97 loaded on my machine. When I try to use the
Chart Wizard, I get an error stating:
Method 'Form' of object '_Subform' failed
Any thoughts? Is there something that...
|
by: Scott Collens |
last post by:
Hi all,
My page is causing a javascript error. The page is test.aspx and contains
a form tag:
<form id="theform" runat="server">
Because I have several user controls on the page each of...
|
by: Larry |
last post by:
Is it possible to show the text that would appear in the default IIS error
page, but have that text appear on the custom form when using the
<customErrors mode="RemoteOnly"...
|
by: Eagle |
last post by:
First I tried using the try, catch, throw, but it errored on the throw and I
don't want it to stop there, I want it to stop in the frm, not the class.
Next I set a Session to catch the error, and...
|
by: Tom Clavel |
last post by:
Scratching my head.
I am using the filter property on a combo box .AfterUpdate event to
get to a single client record. This is causing a some strange
behavior: As I enter a subform, I get a no...
|
by: Blasting Cap |
last post by:
I would like for a page in my app (asp.net framework 2.0, VS 2005) to
both display a message to the user, as well as sending an email when an
error occurs.
I have code in the global.asax.vb...
|
by: ge0193387 |
last post by:
I have an object on my form the does reading from a file and another
that writes to a file. Simple operation just Readline()/Writeline().
I had a problem previously where my form would throw up an...
|
by: mars123 |
last post by:
hi,
I am facing a js error in my code, below is the prob. statement
I have a radio2 javascript function as below, it works like this..
When a parent radio button is selected only one of its...
|
by: munkee |
last post by:
Hi all,
Basically I have been using form validation incorrectly. Partly because of laziness which I now feel is going to really bite me back if I dont get it sorted.
On all of my forms I have a...
|
by: munkee |
last post by:
Hi all,
I have a weird problem and likely just something in my code I am missing completely.
Basically I use similar code on sub form within a form and the after update event runs correctly.
...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |