Python, Dıscord img Scraping Python 3.8

First of all sorry for my bad English. I want to pull the link on but somehow I couldn't. This is an image link.

enter image description here

I'm new to python, it seems like a difficult project for me. I'm waiting for your help. I'm using python 3.8.

This is the output:

Sunucu ID Giriniz : 644945540873846815 Sunucudaki Bir Odanın IDsini Giriniz : 779477013962293249 200 | Sunucuya Ulaşıldı Traceback (most recent call last): File "Discord Badge", line 70, in url_oku=urllib.request.urlopen(url) File "C:\Users\theto\AppData\Local\Programs\Python\Python38\lib\urllib\", line 222, in urlopen return, data, timeout) File "C:\Users\theto\AppData\Local\Programs\Python\Python38\lib\urllib\", line 531, in open response = meth(req, response) File "C:\Users\theto\AppData\Local\Programs\Python\Python38\lib\urllib\", line 640, in http_response response = self.parent.error( File "C:\Users\theto\AppData\Local\Programs\Python\Python38\lib\urllib\", line 569, in error return self._call_chain(*args) File "C:\Users\theto\AppData\Local\Programs\Python\Python38\lib\urllib\", line 502, in _call_chain result = func(*args) File "C:\Users\theto\AppData\Local\Programs\Python\Python38\lib\urllib\", line 649, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 403: Forbidden

This is the code so far:

if (degergir == Deger1):
sunucuid = input('Sunucu ID Giriniz :  ')
odaid = input('Sunucudaki Bir Odanın IDsini Giriniz : ')
gidis2 = '{sunucuid}/{odaid}/'
r ='{sunucuid}/{odaid}/', headers=headers)
if r.status_code == 200:
    print('200 | Sunucuya Ulaşıldı ')
    while True:
        url = '{sunucuid}/{odaid}/'
        aranan=soup.find_all('img',attrs={'class':'avatar-VxgULZ da-avatar'})
        dosya = open("Discord Early.txt","a",encoding="utf-8")
elif r.status_code == 429:
    data = json.loads(r.text)
    print(f'429 | Bİr Hata Var {data["retry_after"]}')
    print(f'Error | {r.status_code} | {r.text}')

Read more here:

Content Attribution

This content was originally published by Exist pela at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: