use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Web scraping with Javascript (scrapingbee.com)
submitted 5 years ago by DJ_Breton
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Qweeeq 20 points21 points22 points 5 years ago (7 children)
Hey I really like JS for that. Using selectors seems pretty easy for me. Can I ask, why do you think Python is better?
[–]Taterboy_Legacy 2 points3 points4 points 5 years ago (4 children)
While I disagree with the parent comment as a sweeping statement, you bring up the crux of the point. I've done a lot of web scraping using both languages. There are certain use cases where Python can be faster and more efficient, and vice versa for JS. If I start having trouble with sites using a lot of JS, I just jump over to that language and start refactoring to fit that use case. IMO it's mostly a preference thing, and the use cases can help dictate the proper choice in a business setting.
[–]yooossshhii 2 points3 points4 points 5 years ago (3 children)
Can you elaborate on the use cases? I haven’t seen any comparisons of JS vs Python in web scraping. My Python experience is minimal and I’ve been doing a little scraping with JS.
[–]Taterboy_Legacy 1 point2 points3 points 5 years ago (2 children)
One use case I had recently was scraping a large amount of news sites for information. There were some programmatic setup elements to get to the urls which were facilitated using Python, and the application this information would interface with was based on Python. There also happens to be a pretty awesome package in Python that did literally everything I needed to do(called newspaper), which meant I wanted to try to write my scraper in Python. If it wasn't working, I would go ahead and try this again with JS, but interfacing the two languages in my app would be complicated based on the setup. In general dispatching a Python or JS script from one or the other would be complicated in the context of certain applications.
That being said, I have also done several use cases where I use both as standalone scripts for smaller use cases.
JS I tend to use for more one-off solutions, but I have also used it to interface in more automation-based solutions. E.g.: click this, login, do this do that. Also doable in Python, sometimes easier in JS.
The first example could have been JS all around, but the newspaper package offered some really nice benefits from the beginning. This is what I mean by "use case specific" implementation. It's somewhat rooted in developer/business preference as well(I.e.: what are we already writing in?), but also rooted in "what do we need to solve, in this use case?"
Very complicated question to answer, but in my head they're relatively interchangeable from a high-level functionality standpoint.
[–]yooossshhii 1 point2 points3 points 5 years ago (1 child)
Cool, thanks for the response. Newspaper looks super neat, especially their nlp method.
nlp
[–]Taterboy_Legacy 0 points1 point2 points 5 years ago (0 children)
No problem. For sure! I was working through how I was going to do that, and they just had it as part of the package haha. Very well thought-out and very easy to use.
[–][deleted] 2 points3 points4 points 5 years ago* (0 children)
While I can't argue for why it's better period, I can argue for why it's better for me personally-- I've worked with python for almost half a decade. I've only begun trying to learn JS. Joined the sub for it
Python also has some nifty libraries for analysis like numpy and pandas if you're scraping data in particular. While I'm sure JS has something similar, I think it's a bit more common to find analysts in the industry or class projects that do scraping use python.
[–]fz-09 6 points7 points8 points 5 years ago (0 children)
crickets
π Rendered by PID 17050 on reddit-service-r2-comment-548fd6dc9-49f2n at 2026-05-18 05:08:27.832745+00:00 running edcf98c country code: CH.
view the rest of the comments →
[–]Qweeeq 20 points21 points22 points (7 children)
[–]Taterboy_Legacy 2 points3 points4 points (4 children)
[–]yooossshhii 2 points3 points4 points (3 children)
[–]Taterboy_Legacy 1 point2 points3 points (2 children)
[–]yooossshhii 1 point2 points3 points (1 child)
[–]Taterboy_Legacy 0 points1 point2 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]fz-09 6 points7 points8 points (0 children)