New answers tagged web-scraping
2
My take, in short:
in programming there is nothing worse than silently swallowing exceptions :) And the fact that you are catching any exception, and not just those related to those specific operations, means than all kinds of errors will go unnoticed.
At the very least, the exceptions should be logged somewhere
be more specific and catch relevant ...
4
Before you can start thinking about doing fancy things like parallelizing this code, you should start by putting your code into functions that do one thing each.
def get_items(response):
# we only want the url before the query strings
# use a set to not have duplicate items
return {item["guid"].split("?")[0] for item in ...
Top 50 recent answers are included
Related Tags
web-scraping × 541python × 367
python-3.x × 184
beautifulsoup × 125
performance × 56
selenium × 52
beginner × 39
vba × 33
object-oriented × 29
javascript × 27
java × 23
python-2.x × 19
php × 18
scrapy × 18
c# × 17
ruby × 17
node.js × 17
excel × 16
regex × 16
html × 15
parsing × 15
http × 15
multithreading × 14
json × 13
xpath × 12