Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

fetch python

import requests

url = 'https://randomfox.ca/floof/'
r = requests.get(url)

print(r.status_code) # 200 (hopefully)

print(r.text) # { "image": "image.jpg", "link": "link.com" }
print(r.json()['image']) # e.g. https://randomfox.ca/images/78.jpg
Comment

python fetch

  url = 'https://explorer.dash.org/insight/address/'
    urlblock = url + addr
    respone_block = requests.get(urlblock)
    byte_string_block = respone_block.content
    source_code_block = html.fromstring(byte_string_block)
    xpatchblock_txid = '/html/body/div[2]/section/section/div[2]/div[2]/div[1]/table/tbody/tr[1]/td[2]'
    blocktreetxid = source_code_block.xpath(xpatchblock_txid)
    blocktxid = str(blocktreetxid[0].text_content())
    # ====================================================
    print(blocktxid)
Comment

PREVIOUS NEXT
Code Example
Python :: python named tuple 
Python :: for each value in column pandas 
Python :: export sklearn.metrics.classification_report as csv 
Python :: jupyter themes 
Python :: django import timezone 
Python :: How to log a python crash? 
Python :: python selenium screenshot 
Python :: how to print an input backwards in python 
Python :: number of columns with no missing values 
Python :: ordered char list python 
Python :: python parse json file 
Python :: check if coroutine python 
Python :: django.db.utils.OperationalError: no such table: 
Python :: python make api request 
Python :: python 3 play sound 
Python :: os file exists 
Python :: average within group by pandas 
Python :: django.core.exceptions.FieldError: Unknown field(s) (author) specified for Comment 
Python :: fill a list with random numbers 
Python :: cosine similarity python numpy 
Python :: save strings with numpy savetext 
Python :: python get name of tkinter frame 
Python :: embed_author discord.py 
Python :: how to change the title of a tkinter widnow 
Python :: random choice without replacement python 
Python :: create sqlite database python 
Python :: log base in python 
Python :: ignition create dataset 
Python :: python nmap 
Python :: find null value for a particular column in dataframe 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =