Coder Social home page Coder Social logo

smartproxy / scrapy Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 25 KB

Scrapy proxy authentication example for Smartproxy

Home Page: https://smartproxy.com

License: MIT License

Python 100.00%
scrapy scraper crawler scraping crawling webscraper data-mining data smartproxy proxy residential https-proxy http-proxy security anonimous-proxies dc-proxy data-crawling proxy-server proxies

scrapy's Introduction

๐Ÿ  Main Repository ๐Ÿ 

Disclaimer

The following example is a simple script showing how to utilize Smartproxy with Scrapy. We suggest to research Scrapy documentation in order to continue development with this tool.

Prerequisites

To get started with Scrapy you will first need to install it using methods provided in their documentation. Check here for more information

Installation

Once you get Scrapy up and running if you have not yet, make sure that you create your project folder. Open the Terminal/Command prompt window and enter the command below:

scrapy startproject yourprojectname

starting scrapy project in anaconda prompt

When project directory is setup, you can now download our test spider code:

  1. Make sure to open the exact location in your project folder using cd .\yourprojectname\yourprojectname\spiders\
  2. To download our example script, run command curl https://raw.githubusercontent.com/Smartproxy/Scrapy/master/smartproxy_spider.py > smartproxy_spider.py
  3. Open the smartproxy_spider.py file and enter your Endpoint, Port as well as replace the Username, Password with your proxy authentication credentials.
  4. Run the script using scrapy crawl smartproxy command.

running scrapy crawl script in anaconda prompt

Note that the code may not run if the smartproxy_spider.py file is in the wrong directory.

How to check if it works?

As mentioned this script only sends a basic request to return a value from the target website.

If you have done all the steps correctly, you should see the result as {'price': 'ยฃ51.77'} along with other actions performed by Scrapy in the Terminal window.

crawling results from target website in terminal window

Need help?

Email - [email protected]
Live chat 24/7

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.