Here in Google App Engines I got this code that would help fetch an HTML code of any web page by its URL:
from google.appengine.api import urlfetch
url = "http://www.google.com/"
result = urlfetch.fetch(url)
if result.status_code == 200:
doSomethingWithResult(result.content)
I don't understand one thing here (among many other things, ...
When I view the source of the page in my browser (FireFox) (View->Page Source), copy it and paste it into my HTML editor, I view almost the same page (In this example it is www.google.com) as it appears in my browser. But when I get the HTML source through this code (through Googles App Engines)
from google.appengine.api import urlfetch...
My app needs to do many datastore operations on each request. I'd like to run them in parallel to get better response times.
For datastore updates I'm doing batch puts so they all happen asynchronously which saves many milliseconds. App Engine allows up to 500 entities to be updated in parallel.
But I haven't found a built-in functio...
I've noticed that some Google services are blocking requests from App Engine servers, resulting in a urlfetch DownloadError. An example would be a feedproxy.google.com url (http://feedproxy.google.com/~r/blabbermouth/~3/cAk78LX4gJE/news.aspx, for example).
This occurs on all the apps I've tried it on, including app IDs I've never used f...
Has anyone got any experience with the following exception when using GAE urlfetch?
DownloadError: ApplicationError: 2 timed out
I'm trying to send a HTTP POST request. Like so:
result = urlfetch.fetch('http://api.nathan.com:8080/Obj/',
method='POST',
payload=pos...
I'm trying to "modularize" a section of an appengine website where a profile is requested as a small hunk of pre-rendered html
Sending a request to /userInfo?id=4992 sends down some html like:
<div>
(image of john) John
Information about this user
</div>
So, from my google appengine code, I need to be able to repeate...
in my app, when I use urlfetch.fetch function to fetch a specified url, I found the content I got is empty for some special html codes.
for example, the url: http://www.club.cn.sodexo.com/node/5071
in real html source, the codes including:
<div class="content">
<div style="width: 219px; height: 262px;" id="gmap-auto3map-gmap0" class="...
The product I am working on runs on top of Google App Engine.
It contains code similar to this:
result = urlfetch.fetch(url, **parms)
log('%s' %result.final_url)
This always returns None. In the documentation it says it will return the correct URL. But this seems to be a problem. I cannot use the given url since there is a lot...
i am trying to fetch the urls using google app engines urlFetch service and implement a proxy site.sites like twitter and and facebook appear disfigured as if they are missing the stylesheet ,even google is missing the google logo but yahoo opens all fine i can't understand why.
...
class sss(webapp.RequestHandler):
def get(self):
url = "http://www.google.com/"
result = urlfetch.fetch(url)
if result.status_code == 200:
self.response.out.write(result.content)
and this view show :
when i change code to this:
if result.status_code == 200:
self.response.out.write(result.content.de...
I noticed what appears to be a limit on simultaneous asynchronous calls of urlfetch in the Java implementation (as noted here: http://code.google.com/appengine/docs/java/urlfetch/overview.html)
but not in the python documentation:
http://code.google.com/appengine/docs/python/urlfetch/asynchronousrequests.html
So is it the case that th...
Is querying for URLs present on ports other than 80 allowed with urlfetch()
I would like to get data from a server on a non-standard port -
http://example.com:8000/WebService?input=a
Ideal example would be web services hosted on non-standard ports.
Can i do this somehow with appengine?
...
I'm aware that urllib2 is available on Google App Engine as a wrapper of Urlfetch and, as you know, Universal Feedparser uses urllib2.
Do you know any method to set a timeout on urllib2 ?
Is timeout parameter on urllib2 been ported on Google App Engine version?
I'm not interested in method like:
rssurldata = urlfetch(rssurl, deadline=...
Hi. I'm trying to upload some records to my local data store using appcfg.py
Only a small number of records are actually inserted and I get the following output (with a ton of errors):
$ appcfg.py upload_data --config_file=bulkloader.yaml --filename=/output.csv --kind=AutoCompleteIndex --url=http://localhost:8084/remote_api .
...
My Gae application retrieves JSON data from a third party site; given an ID representing the item to download , the item's data on this site is organized in multiple pages so my code has to download chunks of data, page after page, until the data of the last available page is retrieved.
My simplified code looks like this:
class FetchDat...
I try to send POST data to a server using urlfetch in AppEngine. Some of these POST-data items has the same name, but with different values.
form_fields = {
"data": "foo",
"data": "bar"
}
form_data = urllib.urlencode(form_fields)
result = urlfetch.fetch(url="http://www.foo.com/", payload=form_data, method=urlfetch.POST, headers={...
Reading the Google App Engine documentation on asynchronous URL Fetch:
The app can have up to 10 simultaneous
asynchronous URL Fetch calls
What happens if an application calls more than 10 async fetch at a time?
Does Google App Engine raise an exception or simply queue the remain calls waiting to serve them?
...
I'm experimenting with the asynchronous URL fetch interface. But when callbacks are used on the production environment, I get an AssertionError.
Is this caused by datastore access in the callback function? What limits are there in the callback function? Are there other APIs that cannot run asynchronously?
Here's the stack...
('The Wa...
The Google App Engine UrlFetchService has a setDeadline FetchOption which is suppose to raise an exception when tripped.
The app can specify the maximum amount of time to wait when it makes the call. If the maximum wait time is exceeded, the call raises an exception.
Which Exception?
If it is an IOException, how should I discrimi...
Hi there!
I'm trying to build some sort of webservice on google apps.
Now the problem is, I need to get data from a website (HTML Scraping).
The request looks like :
URL url = new URL(p_url);
con = (HttpURLConnection) url.openConnection();
InputStreamReader in = new InputStreamReader(con.getInputStream());
BufferedReader reader = ne...