Best practice using selectolax together with if and dict #66
Replies: 2 comments
-
I think using So, try |
Beta Was this translation helpful? Give feedback.
-
Appreciate that! I believe there isn't much other stuff to improve? What Im thinking maybe what could happend if the "text()" is not found - I believe that throws an exception but then that shouldn't happen whenever there is response 200 either way. Thank you so much! You can close if you feel that there isn't other things to improve! |
Beta Was this translation helpful? Give feedback.
-
Hello there Selectolax!
I been using selectolax for a while and also hoping that you are having it well.
I came here not with an issue but rather than a best practice in my situation and I wonder how I could improve my knowledge regarding selectolax. I have written an example code of where I do a requests to a webpage -> Check if the response is 200 and whenever that is, I do another check to see if that value has already been stored -> if not then I would like to get some data from the webpage and in the future I will return the dict with stored parse.
This is what I have written and my concern is that maybe it is not a good idea to do perhaps a if statement to see whenever its there or not and also if its good to do that way when scraping the data and inserting it to a dict? My main goal is to have the fastest speed to get the data
Please feel free to close this ticket if you feel like its abit too off-topic :D
Beta Was this translation helpful? Give feedback.
All reactions