[Release] Parsedom and other functions
#25
ah awesome as I have been struggling for some reason with a urllib POST. Much nicer to do it all with your stuff I reckon.

To get from trunk do I have to pull it from GIT? Do you have your own repo for that or is just in trunk xbmc? Sorry, still a bti new to git.

My code is:

Code:
text = '3051'
        #need to submit the postcode to the weatherzone search
        searchURL = 'http://weatherzone.com.au/search/'
        user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
        headers = { 'User-Agent' : user_agent }        
        #need to fetch a page with POST variables
        values = {'q' : text, 't' : '3', 'action' : '/search/'}
        data = urllib.urlencode(values)
        print 'Encoded:', data
        req = urllib2.Request(searchURL, data, headers)
        response = urllib2.urlopen(req)
        resultPage = str(response.read())
        print response.geturl()
        skimmed = common.parseDOM(resultPage, "ul", attrs = { "class": "typ2" })
        print '*********************', skimmed

...it's just some hacky test code but it's not working grrr...all it does is get the /search/ page without any results as if it is not doing a POST.
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply


Messages In This Thread
[No subject] - by Popeye - 2011-12-09, 12:01
[No subject] - by TobiasTheCommie - 2011-12-09, 17:42
[No subject] - by Popeye - 2011-12-09, 23:16
[No subject] - by TobiasTheCommie - 2011-12-10, 06:43
[No subject] - by _Pierre_ - 2011-12-10, 12:43
[No subject] - by bossanova808 - 2011-12-11, 06:42
[No subject] - by TobiasTheCommie - 2011-12-11, 13:09
[No subject] - by bossanova808 - 2011-12-11, 14:16
[No subject] - by TobiasTheCommie - 2011-12-11, 14:27
[No subject] - by bossanova808 - 2011-12-11, 14:35
[No subject] - by TobiasTheCommie - 2011-12-12, 01:58
[No subject] - by bossanova808 - 2011-12-12, 08:20
[No subject] - by _Pierre_ - 2011-12-12, 11:40
[No subject] - by TobiasTheCommie - 2011-12-12, 12:13
[No subject] - by TobiasTheCommie - 2011-12-12, 14:03
[No subject] - by _Pierre_ - 2011-12-12, 14:13
[No subject] - by TobiasTheCommie - 2011-12-12, 14:34
[No subject] - by _Pierre_ - 2011-12-12, 15:47
[No subject] - by TobiasTheCommie - 2011-12-12, 16:12
[No subject] - by _Pierre_ - 2011-12-12, 18:13
[No subject] - by TobiasTheCommie - 2011-12-12, 18:55
[No subject] - by _Pierre_ - 2011-12-12, 19:11
[No subject] - by TobiasTheCommie - 2011-12-12, 19:24
[No subject] - by bossanova808 - 2011-12-13, 01:20
[No subject] - by TobiasTheCommie - 2011-12-13, 02:00
[No subject] - by bossanova808 - 2011-12-13, 02:06
[No subject] - by TobiasTheCommie - 2011-12-13, 02:28
[No subject] - by bossanova808 - 2011-12-13, 04:10
[No subject] - by newatv2user - 2011-12-13, 06:53
[No subject] - by TobiasTheCommie - 2011-12-13, 15:55
[No subject] - by newatv2user - 2011-12-13, 17:24
[No subject] - by _Pierre_ - 2011-12-13, 20:18
[No subject] - by TobiasTheCommie - 2011-12-13, 23:08
[No subject] - by _Pierre_ - 2011-12-14, 21:25
[No subject] - by TobiasTheCommie - 2011-12-14, 22:13
[No subject] - by _Pierre_ - 2011-12-14, 22:27
[No subject] - by _Pierre_ - 2011-12-15, 20:11
[No subject] - by Martijn - 2011-12-15, 20:17
[No subject] - by _Pierre_ - 2011-12-15, 20:27
[No subject] - by Martijn - 2011-12-15, 20:32
[No subject] - by _Pierre_ - 2011-12-15, 20:35
[No subject] - by TobiasTheCommie - 2011-12-16, 00:33
[No subject] - by TobiasTheCommie - 2011-12-16, 00:37
[No subject] - by bossanova808 - 2011-12-16, 00:54
[No subject] - by bossanova808 - 2011-12-16, 00:55
[No subject] - by TobiasTheCommie - 2011-12-16, 01:40
[No subject] - by newatv2user - 2011-12-16, 02:17
[No subject] - by TobiasTheCommie - 2011-12-16, 02:29
[No subject] - by takoi - 2011-12-20, 23:54
[No subject] - by TobiasTheCommie - 2011-12-21, 00:25
[No subject] - by takoi - 2011-12-21, 13:35
[No subject] - by stacked - 2011-12-22, 04:05
[No subject] - by TobiasTheCommie - 2011-12-22, 04:07
[No subject] - by takoi - 2011-12-25, 22:34
[No subject] - by TobiasTheCommie - 2011-12-25, 23:48
[No subject] - by takoi - 2011-12-26, 01:54
[No subject] - by TobiasTheCommie - 2011-12-26, 03:57
[No subject] - by takoi - 2012-01-03, 15:06
[No subject] - by TobiasTheCommie - 2012-01-03, 15:46
[No subject] - by takoi - 2012-01-05, 17:47
[No subject] - by TobiasTheCommie - 2012-01-05, 17:59
[No subject] - by takoi - 2012-01-08, 15:19
[No subject] - by TobiasTheCommie - 2012-01-08, 15:30
[No subject] - by BlueCop - 2012-01-09, 23:02
[No subject] - by TobiasTheCommie - 2012-01-27, 01:42
[No subject] - by bossanova808 - 2012-01-27, 07:51
[No subject] - by TobiasTheCommie - 2012-01-27, 13:16
[No subject] - by newatv2user - 2012-01-30, 04:34
[No subject] - by TobiasTheCommie - 2012-01-30, 15:49
[No subject] - by newatv2user - 2012-01-31, 02:18
[No subject] - by TobiasTheCommie - 2012-01-31, 02:24
[No subject] - by newatv2user - 2012-01-31, 02:36
[No subject] - by newatv2user - 2012-01-31, 05:22
[No subject] - by newatv2user - 2012-02-04, 06:14
[No subject] - by TobiasTheCommie - 2012-02-04, 12:08
[No subject] - by newatv2user - 2012-02-04, 16:42
[No subject] - by TobiasTheCommie - 2012-02-04, 17:37
[No subject] - by newatv2user - 2012-02-05, 08:34
[No subject] - by TobiasTheCommie - 2012-02-05, 12:11
[No subject] - by newatv2user - 2012-02-05, 16:51
Logout Mark Read Team Forum Stats Members Help
[Release] Parsedom and other functions1