i need help on getting this program working
i need help with my program as i am getting this error
Traceback (most recent call last):
File "main.py", line 143, in <module>
button1 = tk.Button(text="CRAWL", command=Crawling)
NameError: name 'Crawling' is not defined
and im not sure on how to solve it
Voters
change
Crawling
toCRAW.Crawling
@ch1ck3n thank you this solved the problem. Would you happen to know how to take the data printed and transform it into a .csv file?
@Edthehombre In python, if you print the data, what would It show up as? I need to know to answer the question. :D
@Edthehombre Also if the answer helped please click the checkmark next to my name :)
@ch1ck3n how would you check that? unless you mean the data is just printed as words.
@Edthehombre print(data)
@ch1ck3n
I mean if the data is like
data = ["https://google.com", "https://replit.com", "https://youtube.com"]
you can do
@ch1ck3n well i did (print(type(x)) and the data came out as [] [] that
@ch1ck3n oh i checked and the data comes out as a list
@Edthehombre then my code should for above :D
@ch1ck3n im not quite sure how to implement this into my code
@Edthehombre You should add it to where it finished the crawling
@ch1ck3n
what would i replace the item in data with. because it just gives this error
@Edthehombre put it outside of the for loop
@ch1ck3n still not sure what to do here

@Edthehombre il whip up some code
@Edthehombre https://replit.com/@ch1ck3n/amazon-web-crawler#main.py
here you go :D
@ch1ck3n The output should be at export.csv
@ch1ck3n hey thank you so much it works perfectly now, im just wondering if you also know how to sort the data. so when i press a button it will sort it by e.g. title or price
@Edthehombre just put
end = end.sort(key=lambda x : x["price"])
right before line 33@ch1ck3n that'll sort by price
@ch1ck3n would you be able to change that to another variable by the click of a button? so that the user can decide what they want to sort the data by
@Edthehombre Well, it's your project, why don't you do it? ;)
@ch1ck3n not quite sure how to go about it XD