[Tutor] Web Harvesting & AJAX/Javascript

2010-11-29 Thread Roy Hinkelman
pen a browser instance, and PAMIE is quite slow, and I expect Selenium to be quite slow as well. How are you navigating around these Javascript based pages? Is there a library or plugin that I am missing? Thanks in advance. -- Roy Hinkelman **Few people are capable of expressing with equan

Re: [Tutor] Problem Passing VARs to Python from PHP & capturing return string

2010-10-26 Thread Roy Hinkelman
27;images/weather/' ) #write to txt file TEST _temp = 'D:\\Inetpub\\AtoZ\\hometown\\include\\weatherFeed_TEMP.txt' temp = open( _temp, 'w' ) temp.write( _thumb ) temp.close() return _thumb city = 'Establish

Re: [Tutor] Passing VARs to Python from PHP & capturing return string

2010-10-26 Thread Roy Hinkelman
I got it working. As several people mentioned, it was a permissions issue. When I tried the command line, I had admin access, but from the web page, I had only 'Users'. I had to manually change permissions for both the Python module 'mechanize' as well as the txt file the script was writing to. N

Re: [Tutor] Problem Passing VARs to Python from PHP & capturing return string

2010-10-26 Thread Roy Hinkelman
#write to txt file TEST _temp = 'D:\\Inetpub\\AtoZ\\hometown\\include\\weatherFeed_TEMP.txt' temp = open( _temp, 'w' ) temp.write( _thumb ) temp.close() return _thumb city = 'Establish' state = '

[Tutor] Problem Passing VARs to Python from PHP & capturing return string

2010-10-22 Thread Roy Hinkelman
#x27;w' ) temp.write( _thumb ) temp.close() #print _thumb [/code] And my PHP: [code] Python Weather Feed for ' . $city . ', ' . $state . ''; ob_start(); $command = "include/weatherFeed.py -c " . $city . "-s " . $state; exec($com

[Tutor] Problem Passing VARs to Python from PHP & capturing return string

2010-10-22 Thread Roy Hinkelman
My script doesn't want to recognize the variables from the exec() command in PHP. Plus, it won't capture the results of the script. This Python script works in IDLE, and I've got some testing code in there. One Known Unsolved Issue: I put Python in C:\Program Files\Python26\python.exe and have tr

[Tutor] Scraping gov site: site looking for Flash player

2010-04-05 Thread Roy Hinkelman
Interesting. I am using urllib2 to open some government pages, and they have some js checking for Flash on my computer. Is there a way to show them that I have flash? Or possibly another solution? My code: user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' headers = {'User-Agent' : us

Re: [Tutor] File renaming using os.rename problem (spir)

2009-12-08 Thread Roy Hinkelman
I got it. Switched to shutil and made to paths complete paths. The added benefit is that it didn't trash the original file. shutil.copy2(_files_to_mod + "\\" + fname, _files_to_mod + "\\" + new_name) Thanks. -- Forwarded message -- From: Roy Hinkelman

Re: [Tutor] File renaming using os.rename problem (spir)

2009-12-08 Thread Roy Hinkelman
Why don't you simply print out fname? This should point you to the error. Denis I did here: > if fname == old_name: > print fname # test and it looks correct. On an WinXP, should I use shutil instead? Roy ___ Tutor maillist - T

[Tutor] File renaming using os.rename problem

2009-12-08 Thread Roy Hinkelman
I can't find anything on this error I am getting when renaming some files. I'm pulling info from a csv file and parsing it to build new file names. Any pointers appreciated Roy My code: # RENAME FILES using META file - new name = [place]_[state]_[sku].tif import re, os, csv # DEFINE _meta_file

Re: [Tutor] Can't loop thru file and don't see the problem

2009-12-03 Thread Roy Hinkelman
t depend on the file format? I will eventually be working with Excel and possibly mssql tables. Thanks again for your help. Roy On Thu, Dec 3, 2009 at 3:46 AM, Christian Witts wrote: > Roy Hinkelman wrote: > >> >> Your list is great. I've been lurking for the past t

[Tutor] Can't loop thru file and don't see the problem

2009-12-03 Thread Roy Hinkelman
Your list is great. I've been lurking for the past two weeks while I learned the basics. Thanks. I am trying to loop thru 2 files and scrape some data, and the loops are not working. The script is not getting past the first URL from state_list, as the test print shows. If someone could point me