I hereby claim:
- I am wasi0013 on github.
- I am wasi0013 (https://keybase.io/wasi0013) on keybase.
- I have a public key ASCAGYNlyVRTqJo6mqNbusXrz5U2eWcFuYYLhCB4EkhYfAo
To claim this, I am signing this object:
""" | |
Solves basic alpha numeric captchas using pytesseract and PIL | |
NOTE: This program is written for testing difficulties of captchas generated by captcha generator. | |
PLEASE, DO NOT USE IT FOR SPAMMING OR, ABUSING SYSTEMS! | |
Usage: | |
>>> get_captcha_text("https://i.imgur.com/4u7PESk.png") | |
'hWA K n h' | |
It is also possible to use proxy i.e: | |
>>> proxies = {"http": "http://104.236.13.100:8888", "https": "http://104.236.13.100:8888"} |
I hereby claim:
To claim this, I am signing this object:
import requests_html | |
def http2_enabled(url): | |
""" | |
scrape https://tools.keycdn.com/http2-test to find http 2/0 support of the given domain url | |
""" | |
url = url.replace("https://", "").replace("http://", "") | |
session = requests_html.HTMLSession() | |
response = session.get("https://tools.keycdn.com/http2-test") |
import requests_html | |
def crawl(base_url): | |
broken_links = [] | |
session = requests_html.HTMLSession() | |
try: | |
r = session.get(base_url) | |
except: | |
broken_links = [base_url] | |
return broken_links |
import requests | |
filename = "logo.png" | |
document_url = "https://wasi0013.files.wordpress.com/2018/11/my_website_logo_half_circle_green-e1546027650125.png" | |
with open(filename, 'wb') as f: | |
f.write(requests.get(document_url).content) |
import requests | |
chunk_size = 4096 | |
filename = "logo.png" | |
document_url = "https://wasi0013.files.wordpress.com/2018/11/my_website_logo_half_circle_green-e1546027650125.png" | |
headers = { | |
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", | |
"Connection": "keep-alive", | |
} | |
s = requests.Session() | |
cookie = requests.cookies.create_cookie('COOKIE_NAME','COOKIE_VALUE') |
from selenium import webdriver | |
import requests | |
username = "Your Username" | |
password = "Your Password" | |
driver = webdriver.Chrome() | |
# authenticate using username, password | |
login_url = "https://your.target_website.com/login/" | |
driver.get(login_url) |
import json | |
import time | |
from pyvirtualdisplay import Display | |
from selenium import webdriver | |
document_url = "https://www.adobe.com/content/dam/acom/en/accessibility/products/acrobat/pdfs/acrobat-x-accessibility-checker.pdf" | |
download_dir = "/path/to/dir/" | |
# setup a virtual display using pyvirtualdisplay | |
display = Display(visible=0, size=(1768, 1368)) |
# Compute 333.75y6 + x2(11x2y2 – y6 – 121y4 – 2) + 5.5y8 + x/(2y) where x = 77617, y = 33096 | |
defmodule Pow do | |
# https://stackoverflow.com/a/32030190/3083094 | |
require Integer | |
def pow(_, 0), do: 1 | |
def pow(x, n) when Integer.is_odd(n), do: x * pow(x, n - 1) | |
def pow(x, n) do | |
result = pow(x, div(n, 2)) |
import requests_html | |
def unoptimized_images(url): | |
""" | |
find unoptimized images in a webpage | |
:param url: webpage_url | |
:return : tuple of image_count in int, images list of dict | |
""" | |
session = requests_html.HTMLSession() | |
response = session.get(url) | |
images = [] |