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 2697
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: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |