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 :: if elif and else in python 
Python :: create anaconda env 
Python :: python modules list 
Python :: manual merge sort 
Python :: how to make a letter capital in python 
Python :: sorting in python 
Python :: get column names and and index in Pandas dataframe 
Python :: python how to loop 
Python :: what are for loops 
Python :: facet grid, barplot, catplot 
Python :: isenable selenium python 
Python :: python add encoding for non-English language like Arabic 
Python :: Patch loop runner _run_once 
Python :: Simple Kivy pong game 
Python :: using pandas stack and subset to return a dataframe object of highly correated pairs 
Python :: wrds in python 
Python :: pandas form multiindex to column 
Python :: how to add the number to email address in faker library in python? 
Python :: Factory reset the filesystem micropython 
Python :: swap two elements in list python 
Python :: folium add a polygon to a map 
Python :: print poo 
Python :: how to app object pyhthon 
Python :: Finding best model using GridSearchCV 
Python :: calendar range 
Python :: Summarize text using LED huggingface 
Python :: check if there is a certain number difference with python 
Python :: convert month weeks days into month days in python pandas 
Python :: get queryset 
Python :: make image to string to use in tkinter 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =