File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 77from langchain_core .documents import Document
88from .base_node import BaseNode
99from ..utils .remover import remover
10- from ..utils .proxy_rotation import proxy_rotation
10+ from ..utils .proxy_generator import proxy_generator
1111
1212
1313class FetchNode (BaseNode ):
@@ -84,7 +84,7 @@ def execute(self, state):
8484 else :
8585 if self .num_prox > 1 :
8686 loader = AsyncHtmlLoader (
87- source , proxies = proxy_rotation (self .num_prox ))
87+ source , proxies = proxy_generator (self .num_prox ))
8888 else :
8989 loader = AsyncHtmlLoader (source )
9090 document = loader .load ()
Original file line number Diff line number Diff line change 55from .convert_to_csv import convert_to_csv
66from .convert_to_json import convert_to_json
77from .prettify_exec_info import prettify_exec_info
8- from .proxy_rotation import proxy_rotation
8+ from .proxy_generator import proxy_generator
Original file line number Diff line number Diff line change 44from fp .fp import FreeProxy
55
66
7- def proxy_rotation (num_ips : int ):
7+ def proxy_generator (num_ips : int ):
88 """
99 Rotates through a specified number of proxy IPs using the FreeProxy library.
1010
@@ -15,7 +15,7 @@ def proxy_rotation(num_ips: int):
1515 dict: A dictionary containing the rotated proxy IPs, indexed by their position in rotation.
1616
1717 Example:
18- >>> proxy_rotation (5)
18+ >>> proxy_generator (5)
1919 {
2020 0: '192.168.1.1:8080',
2121 1: '103.10.63.135:8080',
@@ -24,9 +24,8 @@ def proxy_rotation(num_ips: int):
2424 4: '113.20.31.250:8080'
2525 }
2626 """
27- res = {}
27+ res = []
2828
2929 for i in range (0 , num_ips ):
30- res [i ] = FreeProxy ().get ()
31-
30+ res .append (FreeProxy ().get ())
3231 return res
You can’t perform that action at this time.
0 commit comments