Note that there are some explanatory texts on larger screens.

plurals
  1. POpython3.3 urllib.request.urlopen cookies
    primarykey
    data
    text
    <p>I ahve a problem with my python script, with one url, it works fine, with the other I seem to get html code from another web page</p> <pre><code>url = "https://api.bitcoinaverage.com/ticker/USD" url = "https://satoshidice.com/api/info" </code></pre> <p>.</p> <pre><code>data = urllib.request.urlopen(url) dataread = data.readall() datadecode = dataread.decode('utf-8') print("datadecode:") print(datadecode) js = json.loads(datadecode) print("JS:") print(js) </code></pre> <p>when url = "<a href="https://api.bitcoinaverage.com/ticker/USD" rel="nofollow">https://api.bitcoinaverage.com/ticker/USD</a>" output:</p> <pre><code>datadecode: { "24h_avg": 230.69, "ask": 244.3, "bid": 244.08, "last": 244.32, "timestamp": "Tue, 05 Nov 2013 15:02:33 -0000", "total_vol": 80993.79 } JS: {'total_vol': 80993.79, 'last': 244.32, 'timestamp': 'Tue, 05 Nov 2013 15:02:33 -0000', '24h_avg': 230.69, 'ask': 244.3, 'bid': 244.08} </code></pre> <p>when url = "<a href="https://satoshidice.com/api/info" rel="nofollow">https://satoshidice.com/api/info</a>" output:</p> <pre><code>datadecode: &lt;HTML&gt; &lt;head&gt; &lt;style&gt; &lt;!-- body,td,div,p,a,font,span{ font-family:arial,sans-serif;} .accent1 {background-color: #DEEFE0} .accent2 {background-color: #006633} --&gt; &lt;/style&gt; &lt;title&gt;How to Enable Cookies&lt;/title&gt; &lt;/head&gt; &lt;body class=search bgcolor=ffffff text=000000 link=0000CC vlink=800080 alink=ff0000 topmargin=3&gt; &lt;script language="JavaScript"&gt; ... Cookies must be enabled in your browser!&lt;/font&gt;&lt;br&gt; </code></pre> <p>From the last line written in the output, I think that I'm being sent to another url because cookies aren't enabled. How would I fix this?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload