What do you want to save?
Add Code snippet
New code examples
-
Python 2021-09-12 01:43:03
urllib urlretrieve python 3
try: from urllib.request import Request, urlopen # Python 3 except ImportError: from urllib2 import Request, urlopen # Python 2 req = Request('http://api.company.com/items/details?country=US&language=en') req.add_header('apikey', 'xxx') con... Add solution -
Other 2021-09-10 22:34:02
get unadjusted stock data
from datetime import datetime import json from urllib.parse import urlencode from urllib.request import urlopen def gethistory(symbol, start=None, end=None): # Return 3 tuples (quotes, dividends and splits) with data from start # to end datetimes ... Add solution -
Python 2021-09-09 16:03:01
Following Links in Python
import urllib from BeautifulSoup import * URL = raw_input("Enter the URL:") #Enter main URL link_line = int(raw_input("Enter position:")) - 1 #The position of link relative to first link count = int(raw_input("Enter count:")... Add solution -
Python 2021-09-07 15:32:01
download pdf from link using python
import urllib.request pdf_path = "" def download_file(download_url, filename): response = urllib.request.urlopen(download_url) file = open(filename + ".pdf", 'wb') file.write(response.read()) file.close() download... Add solution -
Python 2021-09-06 08:01:01
python requests force ipv4
import socket import requests.packages.urllib3.util.connection as urllib3_cn def allowed_gai_family(): family = socket.AF_INET # force IPv4 return family urllib3_cn.allowed_ga... Add solution -
Python 2021-09-04 14:48:02
how to redirect to another page in python
from flask import Flask, redirect, request app = Flask(__name__) from urllib.parse import urlparse, urlunparse FROM_DOMAIN = "yourusername.pythonanywhere.com" TO_DOMAIN = "www.yourdomain.com" @app.before_request def redirect_to_new... Add solution -
Python 2021-09-03 12:52:03
extract url parameters python
#Analysing URL parameters with Python for SEO from pandas import DataFrame, read_csv import urllib.parse as urlparse from urllib.parse import parse_qs input_file = "spreadsheet.csv" output_file = "output.csv" url_column = "Addres... Add solution -
Javascript 2021-09-01 07:42:02
get all youtube playlist videos as json without api python
import urllib, json author = 'Youtube_Username' foundAll = False ind = 1 videos = [] while not foundAll: inp = urllib.urlopen(r'http://gdata.youtube.com/feeds/api/videos?start-index={0}&max-results=50&alt=json&orderby=published&author... Add solution