Beispiel #1
0
def test_get_with_headers():
    h = {'User-Agent': 'NCSA Mosaic/3.0 (Windows 95)'}
    r = ProxyRequests('https://postman-echo.com/headers')
    r.set_headers(h)
    r.get_with_headers()
    assert r.get_status_code() == 200
    assert 'headers' in r.get_json()
    print(r.get_proxy_used())
Beispiel #2
0
def codechecker(code):
        try:
                r = ProxyRequests("https://discordapp.com/api/v6/entitlements/gift-codes/$%s?with_application=false&with_subscription_plan=true" % (code))
                r.get()
                JsonResponse = r.get_json()
                Response = JsonResponse["message"]
                if Response == "Unknown Gift Code":
                        print(f"\x1b[31;1mInvaild Code {code}\n")
                        return
                if Response == "You are being rate limited.":
                        return
                        print("\x1b[31;1mYou Are Being Rate Limited.")
                else:
                        print(f"\x1b[31;1mFound Working Code {code} Site Response:{Response}\n")
                        response = ProxyRequests("https://discordapp.com/api/v6/entitlements/gift-codes/{code}/redeem", json={"channel_id":str(message.channel.id)}, headers={'authorization':token})
                        redeemedcode = (response.text)
                        return
        except Exception as e:
                print(e)
                return
from proxy_requests import ProxyRequests
from proxy_requests import ProxyRequests, ProxyRequestsBasicAuth
import requests
import pandas as pd
from bs4 import BeautifulSoup

page = requests.get(
    'https://forecast.weather.gov/MapClick.php?lat=34.05349000000007&lon=-118.24531999999999#.XiXcNlNKhQI'
)
#print(page.status_code)
soup = BeautifulSoup(page.content, 'html.parser')
#print(soup)
week = soup.find(id='seven-day-forecast-body')
# print(week)

items = week.find_all(class_='tombstone-container')
print(items[0])
url = 'https://forecast.weather.gov/MapClick.php?lat=34.05349000000007&lon=-118.24531999999999#.XiXcNlNKhQI'
r = ProxyRequests(url)
r.get()
r.get_json()
r.get_proxy_used()