Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Nov 20th, 2006, 2:36 AM   #11
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
I suggest you reconstruct the code bit by bit. I tried constructing a test program and it worked fine:
python Syntax (Toggle Plain Text)
  1. from urllib import urlopen
  2. from re import findall
  3. from urlparse import urljoin as basejoin
  4.  
  5. def next_page_finder(site):
  6. site = urlopen(site).read()
  7. next_site_pages = []
  8. next_site_pages.extend(findall(r'\?Brand=\d+\&pg=\d+',site))
  9. new_pages = []
  10. for _ in next_site_pages:
  11. new_pages.append(basejoin("http://www.goldwatches.com/watches.asp",_))
  12. return new_pages
  13.  
  14. print next_page_finder("http://www.goldwatches.com/watches.asp?Brand=11")
Test this program to see if it works on your system, then build up from it until you get your original program. Test it at each stage, and see what causes it to fail.

For instance, perhaps findall is redefined somewhere?
Arevos is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Backup Script :-) Pizentios Perl 18 Jan 12th, 2006 10:50 AM
A simple script isn't working correctly scuzzman Perl 3 Dec 23rd, 2005 6:42 AM
A simple perl script satimis Perl 3 Aug 15th, 2005 9:31 AM
Bash Script Help pelon Bash / Shell Scripting 2 Feb 28th, 2005 3:58 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:11 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC