Udemy

Setting up Scrapy the Development Environment (Updated)

A free video tutorial from Ahmed Rafik
Developer and Online Instructor
Rating: 4.4 out of 5Instructor rating
3 courses
35,146 students
Setting up Scrapy the Development Environment (Updated)

Learn more from the full course

Modern Web Scraping with Python using Scrapy Splash Selenium

Become an expert in web scraping and web crawling using Python 3, Scrapy, Splash and Selenium 2nd EDITION (2021)

08:37:49 of on-demand video • Updated May 2021

Understand the fundamentals of Web Scraping
Scrape websites using Scrapy
Understand Xpath & CSS Selectors
Build a complete Spider from A to Z
Store the extracted Data in MongoDb & SQLite3
Scrape JavaScript websites using Splash & Selenium
Build a CrawlSpider
Understand the Crawling behavior
Build a custom Middleware
Web Scraping best practices
Avoid getting banned while scraping websites
Bypass cloudflare
Scrape APIs
Scrape infinite scroll websites
Working with Cookies
Deploy spiders locally and to the cloud
Run spiders periodically
Prevent storing duplicated data
Build datasets
Login to websites using Scrapy
Download images and files using Scrapy
English [Auto]
Hi guys. How are you all doing? So in this video I'll show you how to install scrapy. But first of all, we need to install Python. I'm not going to install it from the official website. Instead I'll be using Anaconda and there is a good reason behind that. So Anaconda basically will help us installing both Scrapy and Python. Now, from my experience, installing Scrapy without Anaconda, especially on windows is a little bit tricky and you may need to install a couple of dependencies manually. So whether you are running on Windows, Mac OS or Linux, I highly recommend you to use Anaconda. All right, now enough talking. Let's go ahead and download Anaconda. So from your browser, go to anaconda.com and then click download. Now let's scroll down. And as you can see, Anaconda is cross-platform means it runs under Windows, Mac OS and Linux. So depending on your operating system, please go ahead and download Anaconda that comes with Python 3.7. You just have to click on this download button. Okay, I already have it downloaded, so I'm going to open up the downloads tab on Chrome. Here is the installer, as you can see. So I'm going to open it up. Right now. I'm going to click next. And the installation process is pretty much similar to any operating system. You only have to click a couple of buttons and you are good to go. Okay, now I'm going to click. I agree. And then next. And then next. And then I'm going to click install. It's going to take a while, so I'm going to pause the video right now. I'll be back when everything is set up. All right, perfect. Now I'm going to click next and then next. And then let's uncheck this one. And this one. Let's click finish. All right, perfect. Now, to be able to interact with Anaconda, we have two options. We either can use the anaconda. Prompt. And then within this anaconda prompt, we can write, for example, commands to create an environment. Activate an environment and install packages. We are not going to use the Anaconda prompt. Instead we will use. The Anaconda Navigator, this one, which is basically a graphical user interface to interact with Anaconda. So let's open it up. It's going to take a little bit of time when you open it up for the first time. So bear with me. All right. So here's how the UI or the user interface of the Anaconda Navigator looks like. Here we have a couple of pre-installed apps and those apps are installed on the base environment. This one, okay, we are not going to install Scrapy in that same environment, so let's go ahead and create a new one. So let's click environments. And then let's click Create. Let's give it a name. I'm going to call this one virtual and then underline workspace. You can call it whatever you want. And then down here, make sure you are selecting Python and the version as 3.7. Okay. Now let's go ahead and click Create. It's going to take a little bit of time. All right. Perfect. So as you can see, the environment has been created. Now, the next thing we have to do is to install scrapy. So back to Chrome. I'm going to open up a new tab. And then let's go to scrapy.org. Now, since we are using Anaconda, let's go ahead and click on Conda. Let's scroll down and then let's copy this command. Now back to the Anaconda Navigator. Click on this play button and then open terminal. All right. So as you can see, this will open up the command prompt. And here it says that we are using the virtual underline workspace environment we just created. So every package we install, it's going to be installed only within that virtual underline workspace environment. Okay. Now let's paste the command we've just copied. There we go. Now the latest version of Scrapy. At the time of recording this video is version 2.0.1. I'm not going to use that version. Instead, I'll be using version 1.6 and later in the course I cover what's new on version two. Okay, so to install version 1.6, we add double equal signs and then 1.6. There we go. And then in addition to Scrapy, I want to also install a package called Pylint, which is basically a python linter and another one called Auto Pep eight to follow the Pep eight standard in Python. Now finally I'm going to add hyphen y to accept installing all the packages. Okay, now I'm going to press enter. This will take a while. So I'm going to fast forward the video a little bit. All right, Perfect. Now to check if Scrapy was installed correctly. I'm going to clear up everything using the command CLS on windows. If you are using Mac, you just type in clear like that. Okay. And then let's go ahead and type Scrapy. Let's press enter. And as you can see, we have Scrapey version 1.6. All right. Now, one last thing before we finish up this video. And regarding the code editing software I'll be using throughout this course is called Visual Studio Code. It's a very known code editing software nowadays. It's fast and super easy to use. So let me show you how you can download and install it. So back to Chrome. And let's search for code visual. Studio. Let's open up this first link. All right, now to download Visual Studio code, just click on this button. It's available under macOS Windows and Linux. Okay, I already have it downloaded, so I'm going to open up the downloads tab again. Okay, here is the installer, so I'm going to open it up. Let's click accept. And then next. Next. And then next. Let's click next and then install. All right. Now I'm going to uncheck launch Visual Studio code and then let's click Finish. And then let's go ahead and close the Anaconda Navigator. Let's open it up again. All right. Now, within the Anaconda Navigator, we can launch Visual Studio code. So first of all, make sure you are using the virtual underline workspace environment in which we installed Scrapy. So let's select it. Here is vs code, as you can see. So to execute it, just click on this launch button. Let's wait a little bit. All right. Perfect. It's launching vs code. Now, one last thing for macOS users. If you don't see vs code inside the Anaconda Navigator, please follow the steps in the article down below this video. Okay, so this was everything for this video. See you guys in the next one.