Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import requests
from requests.exceptions import MissingSchema
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import requests
from lxml import etree
from fake_useragent import UserAgent
ua = UserAgent()
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import requests
def download_stream(video_url, video_name):
with open(video_name, 'wb') as handle:
response = requests.get(video_url, stream=True)
#!/bin/bash/env python
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
driver = webdriver.Firefox()
driver.get("https://www.flipkart.com/search?q=xbox&marketplace=FLIPKART&sid=search.flipkart.com")
elem = driver.find_elements_by_xpath('//img[contains(@class, "_30XEf0")]')
@p3t3r67x0
p3t3r67x0 / german_zipcode_latlng.json
Created July 4, 2018 22:51
German zipcodes with latitude and longitude coordinates.
[{
"zip": "01067",
"lat": 51.05754959999999,
"lng": 13.7170648
},
{
"zip": "01069",
"lat": 51.0391349,
"lng": 13.7376748
},

Variables

You need variables to store some data. Variables always starts with a $ sign followed by lower- or uppercase letters or an underscore. You should allocate some data to variables so you can access this data later when calling a variable.

$string = "Hello World!";
$boolean = true;
$integer = 123;
$float = 0.29;
This file has been truncated, but you can view the full file.
[
{
"boundingbox": [
"51.0534001144",
"51.0535001144",
"13.726116130257",
"13.726216130257"
],
"lat": "51.0534501143995",
"lon": "13.7261661302568",
#!/usr/bin/env python
import sys
import uuid
import requests
from lxml import html
from sqlalchemy import create_engine, Column, Integer, String, UniqueConstraint
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.exc import IntegrityError
This file has been truncated, but you can view the full file.
Gutenberg-Apotheke
Düpheid 24/ Ladenzentrum
22149 Hamburg
040/6725758
Schimmelreiter-Apotheke
Hegeneck 5
22149 Hamburg
040/6723838
We can't make this file beautiful and searchable because it's too large.
Baden-Württemberg 64754 Eberbach (Baden)
Baden-Württemberg 68159 Jungbusch
Baden-Württemberg 68159 Mannheim
Baden-Württemberg 68161 Schwetzingerstadt
Baden-Württemberg 68161 Mannheim
Baden-Württemberg 68161 Oststadt
Baden-Württemberg 68163 Neuostheim
Baden-Württemberg 68163 Lindenhof
Baden-Württemberg 68163 Mannheim
Baden-Württemberg 68163 Neuhermsheim