py2ls 0.1.9.6__py3-none-any.whl → 0.1.9.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
py2ls/.DS_Store
CHANGED
Binary file
|
py2ls/netfinder.py
CHANGED
@@ -209,6 +209,13 @@ def get_soup(url, driver="req"):
|
|
209
209
|
return soup_
|
210
210
|
|
211
211
|
|
212
|
+
def get_cookies(url, login={"username": "your_username", "password": "your_password"}):
|
213
|
+
session = requests.Session()
|
214
|
+
response = session.post(url, login)
|
215
|
+
cookies_dict = session.cookies.get_dict()
|
216
|
+
return cookies_dict
|
217
|
+
|
218
|
+
|
212
219
|
def fetch_all(
|
213
220
|
url,
|
214
221
|
parser="lxml",
|
@@ -230,6 +237,7 @@ def fetch_all(
|
|
230
237
|
javascript=True, # Add JavaScript option
|
231
238
|
disable_images=False, # Add option to disable images
|
232
239
|
iframe_name=None,
|
240
|
+
login_dict=None,
|
233
241
|
): # Add option to handle iframe): # lxml is faster, # parser="html.parser"
|
234
242
|
try:
|
235
243
|
# # Generate a random user-agent string
|
@@ -302,6 +310,12 @@ def fetch_all(
|
|
302
310
|
|
303
311
|
driver_ = webdriver.Chrome(service=service, options=chrome_options)
|
304
312
|
|
313
|
+
if login_url and login_dict:
|
314
|
+
cookies = get_cookies(url=login_url, login=login_dict)
|
315
|
+
driver_.get(url)
|
316
|
+
for cookie_name, cookie_value in cookies.items():
|
317
|
+
driver_.add_cookie({"name": cookie_name, "value": cookie_value})
|
318
|
+
|
305
319
|
if not javascript:
|
306
320
|
driver_.execute_cdp_cmd(
|
307
321
|
"Emulation.setScriptExecutionDisabled", {"value": True}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
py2ls/.DS_Store,sha256=
|
1
|
+
py2ls/.DS_Store,sha256=BloZZz2vlFVfF-I3X7ZsqXusvqOawJMx7erKcnIP-b0,6148
|
2
2
|
py2ls/.git/COMMIT_EDITMSG,sha256=5xj-jWMbrdOc9m7gSn-UcsAQ9FMNvWSbLWSsrOUIO5w,7
|
3
3
|
py2ls/.git/FETCH_HEAD,sha256=6cJaQzb6VhkvNNm-KsABX6R28FNKZB8qMmqacDEP_dQ,100
|
4
4
|
py2ls/.git/HEAD,sha256=KNJb-Cr0wOK3L1CVmyvrhZ4-YLljCl6MYD2tTdsrboA,21
|
@@ -174,13 +174,13 @@ py2ls/doc.py,sha256=xN3g1OWfoaGUhikbJ0NqbN5eKy1VZVvWwRlhHMgyVEc,4243
|
|
174
174
|
py2ls/export_requirements.py,sha256=x2WgUF0jYKz9GfA1MVKN-MdsM-oQ8yUeC6Ua8oCymio,2325
|
175
175
|
py2ls/freqanalysis.py,sha256=F4218VSPbgL5tnngh6xNCYuNnfR-F_QjECUUxrPYZss,32594
|
176
176
|
py2ls/ips.py,sha256=N7MdOCgJXDQu73YkJQTtDN3RSntzXX7V0MOJ1NYBLEk,100572
|
177
|
-
py2ls/netfinder.py,sha256=
|
177
|
+
py2ls/netfinder.py,sha256=vBwadoT0c9doz11qD1VxpagvYaaTHocMasa2xvHjAkI,49733
|
178
178
|
py2ls/plot.py,sha256=Cpx0cZoU-TN-q3Awmk75DYZsN4nGpnB_dHh262l_-Is,86130
|
179
179
|
py2ls/setuptools-70.1.0-py3-none-any.whl,sha256=2bi3cUVal8ip86s0SOvgspteEF8SKLukECi-EWmFomc,882588
|
180
180
|
py2ls/sleep_events_detectors.py,sha256=bQA3HJqv5qnYKJJEIhCyhlDtkXQfIzqksnD0YRXso68,52145
|
181
181
|
py2ls/stats.py,sha256=U2yeTYUkInI4JXtfhdSbSAzna_h8rh8MZmY31o51_EU,38169
|
182
182
|
py2ls/translator.py,sha256=bc5FB-wqC4TtQz9gyCP1mE38HqNRJ_pmuRIgKnAlMzM,30581
|
183
183
|
py2ls/wb_detector.py,sha256=7y6TmBUj9exCZeIgBAJ_9hwuhkDh1x_-yg4dvNY1_GQ,6284
|
184
|
-
py2ls-0.1.9.
|
185
|
-
py2ls-0.1.9.
|
186
|
-
py2ls-0.1.9.
|
184
|
+
py2ls-0.1.9.7.dist-info/METADATA,sha256=srGoKyBsLj4Lkid5Ao60j521vzOKgkXl8Zyoyd6SFLI,20017
|
185
|
+
py2ls-0.1.9.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
186
|
+
py2ls-0.1.9.7.dist-info/RECORD,,
|
File without changes
|