Giter Site home page Giter Site logo

http proxy support? about webmagic HOT 4 CLOSED

code4craft avatar code4craft commented on August 15, 2024
http proxy support?

from webmagic.

Comments (4)

yuany avatar yuany commented on August 15, 2024

the core of crawling is httpClient, so I think it support proxy, but it need covert it in implement.

from webmagic.

code4craft avatar code4craft commented on August 15, 2024

You can override HttpClientDownloader.download() (copy most codes of the method) to implements HttpProxy in 0.3.0 and below.
example

HttpClientDownloader is too complex, I will refactor it in next version. HttpProxy will also be supported.

from webmagic.

l1z2g9 avatar l1z2g9 commented on August 15, 2024

Thanks.

In the begining, I consider webmagic is base on jsoup, but now I get that it is built on HttpClient.

I googled some code snippet about jsoup, it is supported as this style of http proxy.

System.setProperty("http.proxyHost", "proxyserver");
System.setProperty("http.proxyPort", "8080");

Document doc = Jsoup.connect("http://www.g.cn").get();
System.out.println("content " + doc.html());

Hope these convenient configuration would be supported in webmagic in future.

from webmagic.

code4craft avatar code4craft commented on August 15, 2024

will be supoorted in 0.4.0, usage:

site.setHttpProxy(new HttpHost("your-host",port)

from webmagic.

Related Issues (20)

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.