File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -45,8 +45,11 @@ def setUp(self):
4545 elif self .connection_method == "freeproxy" :
4646 proxy_generator .FreeProxies ()
4747 scholarly .use_proxy (proxy_generator )
48+ elif self .connection_method == "scraperapi" :
49+ proxy_generator .ScraperAPI (os .getenv ('SCRAPER_API_KEY' ))
50+ scholarly .use_proxy (proxy_generator )
4851 else :
49- scholarly .use_proxy (None )
52+ scholarly .use_proxy (None )
5053
5154 def test_tor_launch_own_process (self ):
5255 """
@@ -228,13 +231,7 @@ def test_extract_author_id_list(self):
228231 author_id_list = pub_parser ._get_author_id_list (author_html_partial )
229232 self .assertTrue (author_id_list [3 ] == 'TEndP-sAAAAJ' )
230233
231- def test_ScraperAPI (self ):
232- proxy_generator = ProxyGenerator ()
233- proxy_generator .ScraperAPI (os .getenv ('SCRAPER_API_KEY' ))
234- scholarly .set_timeout (60 )
235234
236- ## Uses another method to test that proxy is working.
237- self .test_search_keyword ()
238235
239236
240237if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments