Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
299 views
in Technique[技术] by (71.8m points)

I want to add comments to a text file using Selenium with Python

I want to add comments to a text file using Selenium with Python but No matter how hard I tried I couldn't find and couldn't do. I tried so many code but not works. One of the codes I've tried:

yorumlar = browser.find_elements_by_class_name('Mr508')
yorumlars = []
for element in elements:
    yorumlars.append(element.text)

yorumlarCount = 1

with open("commends.txt","w",encoding = "UTF-8") as file:
    for yorumlar in yorumlars:
        file.write(str(yorumlarCount) + ".
" + yorumlar + "
")
        file.write("**********
")
        yorumlarCount += 1

I'm trying to pull the comments on all posts of one of the Instagram pages. If you know please answer my question I have to do this code because I will get points from this code. Thanks, come easy.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...