Class: ProxyFetcher::Providers::HTTPTunnel
- Defined in:
- lib/proxy_fetcher/providers/http_tunnel.rb
Overview
HTTPTunnel provider class.
Instance Method Summary collapse
-
#provider_url ⇒ Object
Provider URL to fetch proxy list.
-
#to_proxy(html_node) ⇒ ProxyFetcher::Proxy
Converts HTML node (entry of N tags) to
ProxyFetcher::Proxy
object. - #xpath ⇒ Object
Methods inherited from Base
#fetch_proxies, fetch_proxies!, #provider_headers, #provider_method, #provider_params
Instance Method Details
#provider_url ⇒ Object
Provider URL to fetch proxy list
8 9 10 |
# File 'lib/proxy_fetcher/providers/http_tunnel.rb', line 8 def provider_url "http://www.httptunnel.ge/ProxyListForFree.aspx" end |
#to_proxy(html_node) ⇒ ProxyFetcher::Proxy
Converts HTML node (entry of N tags) to ProxyFetcher::Proxy
object.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/proxy_fetcher/providers/http_tunnel.rb', line 25 def to_proxy(html_node) ProxyFetcher::Proxy.new.tap do |proxy| uri = parse_proxy_uri(html_node) proxy.addr = uri.host proxy.port = uri.port proxy.country = parse_country(html_node) proxy.anonymity = parse_anonymity(html_node) proxy.type = ProxyFetcher::Proxy::HTTP end end |
#xpath ⇒ Object
12 13 14 |
# File 'lib/proxy_fetcher/providers/http_tunnel.rb', line 12 def xpath '//table[contains(@id, "GridView")]/tr[(count(td)>2)]' end |