Templar adlı üyeden alıntı: mesajı görüntüle
Tüm projeyi atmam lazım. Başka arkadaşa ait olduğu için atamıyorum.
kod bu aşağı yukarı

try:
veri = {
"gidis" : secici.xpath("//div[@class='body-text']").get(),
"gelis" : secici.xpath("//div[@class='base']").get()
}
except (AttributeError, TypeError):
return None


if veri['gidis']:


with open(f'@{SESSION_ADI}.html', 'w+', encoding='utf-8') as dosya:
html += f"""
<div class="probs">
<div class="prob">
<h3>Gidis</h3>
{veri['gidis'].replace('src="//', 'src="https://')}
</div>
<div class="prob">
<h3>Gelis</h3>
{veri['gelis'].replace('src="//', 'src="https://')}
</div>
</div>
"""
html_cikti = HTMLBeautifier.beautify(html, indent=2, encoding='utf-8')
dosya.write(html_cikti)
return f'@{SESSION_ADI}.html'
else:
return None

ben burda sizin verdiğinizi bu şekilde denedim
try:
verix={
kisaltma="https://bc.vc/api.php?key=111111&uid=111&url="
cevappp = secici.xpath("//div[@class='base']//img[@src]").attrib.get('src')
kisalink = kisaltma + cevappp
}
except (AttributeError, TypeError):
return None


istekli = scraper.get(kisalink)
yapmak istediğimde bu siteden fotoğrafın linkini alıp link kısaltmaya göndercem.
bir sözlük yapısı oluşturmak istiyorsunuz anladığım kadarıyla fakat ona ihtiyacınız yok aşağıdaki kod işinizi görecektir
https://pastebin.ubuntu.com/p/KFS4DgvPgp/