Skip to main content
Commonmark migration
Source Link

###Now, about the code

Now, about the code

###Intro

Intro

###Coding around

Coding around

###Now, about the code

###Intro

###Coding around

Now, about the code

Intro

Coding around

added 6 characters in body
Source Link
Grajdeanu Alex
  • 9.2k
  • 4
  • 31
  • 70

If you were paying attention, the website adds \url\default\url\video\default-N.htm at the end of the url depending on the set of pages you click in the bottom of the page. There's a total of 13 urls.

If you were paying attention, the website adds \url\default-N.htm at the end of the url depending on the set of pages you click in the bottom of the page. There's a total of 13 urls.

If you were paying attention, the website adds \url\video\default-N.htm at the end of the url depending on the set of pages you click in the bottom of the page. There's a total of 13 urls.

added 233 characters in body
Source Link
Grajdeanu Alex
  • 9.2k
  • 4
  • 31
  • 70
  • it's not necessary to create a new session in all of your functions. It's preferred to create only one session for the same website as it can give a boost of speed to your scrapper. More, the session object allows you to persist certain parameters across requests (if needed);
  • you only use got_already in your last function, so define it there. Or better yet, use a Set()
  • instead of if "author" not in title and "year" not in title you can use all()
  • PAGE_LINK is irrelevant and confusing. You can build your full video links using just BLINK.
  • last but not least, I'd use beautifulsoup for html parsing: but, here I'd like to add that The downside of using this parser is that it is much slower than the HTML parser of lxml. So if performance matters, you might want to consider using soupparser only as a fallback for certain cases.
  • it's not necessary to create a new session in all of your functions. It's preferred to create only one session for the same website as it can give a boost of speed to your scrapper. More, the session object allows you to persist certain parameters across requests (if needed);
  • you only use got_already in your last function, so define it there. Or better yet, use a Set()
  • instead of if "author" not in title and "year" not in title you can use all()
  • PAGE_LINK is irrelevant and confusing. You can build your full video links using just BLINK.
  • last but not least, I'd use beautifulsoup for html parsing
  • it's not necessary to create a new session in all of your functions. It's preferred to create only one session for the same website as it can give a boost of speed to your scrapper. More, the session object allows you to persist certain parameters across requests (if needed);
  • you only use got_already in your last function, so define it there. Or better yet, use a Set()
  • instead of if "author" not in title and "year" not in title you can use all()
  • PAGE_LINK is irrelevant and confusing. You can build your full video links using just BLINK.
  • last but not least, I'd use beautifulsoup for html parsing: but, here I'd like to add that The downside of using this parser is that it is much slower than the HTML parser of lxml. So if performance matters, you might want to consider using soupparser only as a fallback for certain cases.
added 2212 characters in body
Source Link
Grajdeanu Alex
  • 9.2k
  • 4
  • 31
  • 70
Loading
added 133 characters in body
Source Link
Grajdeanu Alex
  • 9.2k
  • 4
  • 31
  • 70
Loading
added 85 characters in body
Source Link
Grajdeanu Alex
  • 9.2k
  • 4
  • 31
  • 70
Loading
added 85 characters in body
Source Link
Grajdeanu Alex
  • 9.2k
  • 4
  • 31
  • 70
Loading
Source Link
Grajdeanu Alex
  • 9.2k
  • 4
  • 31
  • 70
Loading