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 :: get value of a list of dictionary matching key 
Python :: how to print a character n times in python 
Python :: .all() python numpy 
Python :: get user id discord.py 
Python :: how to reverse a number 
Python :: how to make an application using python 
Python :: django abstractuser fields 
Python :: inverting a dictionary 
Python :: return render django 
Python :: extract list from string python 
Python :: python __dict__ 
Python :: age calculator python 
Python :: scikit decision tree regressor 
Python :: pandas append dataframes with same columns 
Python :: python string caps lock 
Python :: how to plot using pyplot 
Python :: graph outlier detection 
Python :: Tree: Inorder Traversal 
Python :: list unpacking python 
Python :: numpy and operator 
Python :: import os python 
Python :: python dictionary if not found 
Python :: numpy indexing 
Python :: change value of column in pandas 
Python :: Issue AttributeError: ‘numpy.ndarray’ object has no attribute ‘index’ 
Python :: any and all in python3 
Python :: python 3.9 release date 
Python :: python how to add 2 numbers 
Python :: Convert .tif images files to .jpeg in python 
Python :: python array drop item 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =