sachin-sankar / swiftshadow

Free IP Proxy rotator library for python
https://sachin-sankar.github.io/swiftshadow/
GNU General Public License v3.0
92 stars 6 forks source link

'list' object has no attribute 'get'. #29

Open whitks opened 3 months ago

whitks commented 3 months ago

I was trying to use this through requests. Python version = 3.11.6 it says list object has no attribute 'get' It is doing that because for some reason swift.proxy is returning a list instead of dictionary.

sachin-sankar commented 3 months ago

can you post the code?

whitks commented 3 months ago

I had to typecast into a dictionary, it worked after that:

def get_json_data(url : str):
    # Send a request to the website
    prox = swift.proxy()
    response = requests.get(url, proxies = {prox[0]:prox[1]})
    full_data = response.json()
    return full_data