Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

list files in http directory python

import requests
from bs4 import BeautifulSoup

def get_url_paths(url, ext='', params={}):
    response = requests.get(url, params=params)
    if response.ok:
        response_text = response.text
    else:
        return response.raise_for_status()
    soup = BeautifulSoup(response_text, 'html.parser')
    parent = [url + node.get('href') for node in soup.find_all('a') if node.get('href').endswith(ext)]
    return parent

url = 'http://cdimage.debian.org/debian-cd/8.2.0-live/i386/iso-hybrid'
ext = 'iso'
result = get_url_paths(url, ext)
print(result)
Comment

PREVIOUS NEXT
Code Example
Python :: python script that executes at time 
Python :: python tkinter listbox detect selection change 
Python :: python convert image to base64 
Python :: python list pop multiple 
Python :: python declare variables from dictionary 
Python :: Django populate form from database 
Python :: remove prefix from string python 
Python :: convert tensor to numpy array 
Python :: python verify if string is a float 
Python :: how to know if a key is in a dictionary python 
Python :: python visualize fft of an image 
Python :: flask blueprint 
Python :: python-telegram-bot send file 
Python :: np.where 
Python :: create dict from two lists 
Python :: scrapy proxy pool 
Python :: virtual mic with python 
Python :: fibonacci series using dynamic programmig approach 
Python :: how to insert item at specifc index python 
Python :: python advanced programs time module 
Python :: logging 
Python :: max heap python 
Python :: python enum advanced 
Python :: scrapy get inside attribute value 
Python :: doomsday fuel foobar 
Python :: python raise exception 
Python :: baeutifulsoup find element with text 
Python :: numpy random choice 
Python :: python euclidean distance 
Python :: increase recursion depth google colab 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =