Code Monkey home page Code Monkey logo

proxy-scraper's People

Contributors

sleeyax avatar vantoozz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

proxy-scraper's Issues

Implement method to get proxy protocol

From the README file:

$scraper = new Scrapers\FreeProxyListScraper($httpClient);

foreach ($scraper->get() as $proxy) {
    echo (string)$proxy . "\n";
}

This will output ip:port.
I think currently there is no way to get the proxy protocol (HTTP, HTTPS, SOCKS) too.
If this is implemented, users can create filters like for example:

foreach ($scraper->get() as $proxy) {
    // Only show proxies with the HTTPS protocol
    if ($proxy->getProtocol() == "HTTPS") {
        echo (string)$proxy .  "\n";
    }
}

If the protocol can't be scraped (this is mostly the case with online .txt lists) maybe you can just return ANY or null when using $proxy->getProtocol().

Installation error: satisfiable by vantoozz/proxy-scraper[v1.8.0, v1.8.1]

Hello,

I am using PHP 7.1.33 and Composer version 1.9.1 2019-11-01 17:20:17.

When trying to install proxy-scraper like the following I get an error:

C:\Users\Code\project>composer require php-http/guzzle6-adapter
Using version ^2.0 for php-http/guzzle6-adapter
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 9 installs, 0 updates, 0 removals
  - Installing ralouphie/getallheaders (3.0.3): Loading from cache
  - Installing psr/http-message (1.0.1): Loading from cache
  - Installing guzzlehttp/psr7 (1.6.1): Loading from cache
  - Installing guzzlehttp/promises (v1.3.1): Loading from cache
  - Installing guzzlehttp/guzzle (6.5.2): Loading from cache
  - Installing psr/http-client (1.0.0): Loading from cache
  - Installing php-http/promise (v1.0.0): Loading from cache
  - Installing php-http/httplug (2.1.0): Loading from cache
  - Installing php-http/guzzle6-adapter (v2.0.1): Loading from cache
guzzlehttp/psr7 suggests installing zendframework/zend-httphandlerrunner (Emit PSR-7 responses)
guzzlehttp/guzzle suggests installing psr/log (Required for using the Log middleware)
guzzlehttp/guzzle suggests installing ext-intl (Required for Internationalized Domain Name (IDN) support)
Writing lock file
Generating autoload files

C:\Users\Code\project>composer require vantoozz/proxy-scraper
Using version ^1.8 for vantoozz/proxy-scraper
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for vantoozz/proxy-scraper ^1.8 -> satisfiable by vantoozz/proxy-scraper[v1.8.0, v1.8.1].
    - Can only install one of: php-http/httplug[v1.1.0, 2.1.0].
    - Can only install one of: php-http/httplug[v1.1.0, 2.1.0].
    - Can only install one of: php-http/httplug[v1.1.0, 2.1.0].
    - Conclusion: install php-http/httplug v1.1.0
    - Installation request for php-http/httplug (locked at 2.1.0) -> satisfiable by php-http/httplug[2.1.0].


Installation failed, reverting ./composer.json to its original content.

Any suggestions what I am doing wrong?

I appreciate your replies!

Add custom headers

Awesome library!

Could you add support to add custom headers? It is quite a requirement to add custom user agent / referrer because many websites will block you from scraping too often.

Your requirements could not be resolved to an installable set of packages.

composer require vantoozz/proxy-scraper:~2 php-http/guzzle6-adapter hanneskod/classtools
I have this output :

Using version ^1.2 for hanneskod/classtools
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Can only install one of: vantoozz/proxy-scraper[v2.0.0, dev-master].
    - Can only install one of: vantoozz/proxy-scraper[v2.0.1, dev-master].
    - Can only install one of: vantoozz/proxy-scraper[v2.1.0, dev-master].
    - Installation request for vantoozz/proxy-scraper dev-master -> satisfiable by vantoozz/proxy-scraper[dev-master].
    - Installation request for vantoozz/proxy-scraper ~2 -> satisfiable by vantoozz/proxy-scraper[v2.0.0, v2.0.1, v2.1.0].

What can I do to fix it ?

PHP 7.0 support

Hi, I've forked your repo and created a branch with php7.0 support.

If you want, I'll make a pull request

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.