Answer the question
In order to leave comments, you need to log in
Why can't I transfer text from a block to a text document?
I am writing a site parser with cs:go skins, you need to know the name of the skin, quality and price.
But, this data is not loaded into the text editor.
from selenium import webdriver
driver = webdriver.Chrome(executable_path="E:\\Users\\Azuki\\PycharmProjects\\pars\\chromedriver\\chromedriver.exe")
f = open("skinsinfo.txt", "w")
count = 0
i = 0
try:
with open('skins.txt', 'r') as f:
for line in f:
driver.get(line)
checkname = driver.find_element_by_class_name("skin-name")
print(checkname.text)
checkinfo = driver.find_element_by_class_name('info-item')
print(checkinfo.text)
checkprice = driver.find_element_by_class_name('min-price-value')
print(checkprice.text)
skinsinfo = str(checkname+("|")+checkinfo+("|")+checkprice) + "\n"
f.write(skinsinfo)
except Exception as ex:
print(ex)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question