Login Register


Python Selenium Help filter_list
Author
Message
Python Selenium Help #1
i havent messed with it much so please dont judge me Sad

i wrote a program uses selemium gekodriver to auto scan dork list for urls than from scanned urls it passes to auto sqli vuln chcker and title cehcker . blah blah blah :/

it runs fine for while till google-cookie starts to fill and if i manual deleted the file it runs perfectly fine for an hour or so ..

so long story short is there a way i can code it to auto clean google-cookie file out itself?? Or is that impossible ? from the basic research i did everyone just said introduce a sleep witch yes in the short run it will have an impact but the file will still fill up just will take longer and ill be stuck in the same boat

(Sorry if this isnt the correct section or correct format to be asking )


RE: Python Selenium Help #2
(02-10-2021, 03:40 AM)Einsatzgruppe Wrote: so long story short is there a way i can code it to auto clean google-cookie file out itself?? Or is that impossible ? from the basic research i did everyone just said introduce a sleep  witch yes in the short run it will have an impact  but the file will still fill up just will take longer  and ill be stuck in the same boat

Hello. Since you do not want to use time.sleep() I would suggest something along the lines of:

Code:
from os import remove try: remove(path_to_file) except OSError: pass

This is what I get when trying to delete a non existent file:

Code:
>>> from os import remove >>> remove("12345.txt") Traceback (most recent call last): File "<stdin>", line 1, in <module> OSError: [Errno 2] No such file or directory: '12345.txt' >>> try: ... remove("12345.txt") ... except OSError: ... pass ... >>>

Using the try and except is necessary is you do not want to wait for the file to be created or if you do not know how long it takes to be created after deleting.
Code:
  _______              _   _________   \      \            | | /        /   |      | _____  ____| | |   ____/ _____  _____  _____  _____   |   |  |/  _  \/      | \____   |/     \/     \/  ___\/  _  \   |      |    __/|  |   |/        |   |  |   |   \  \__ |   __/  /_______/\_____/\____|_/________/|  ____/\_____|_\____/\_____/                                   | |                                   |_/                         BTC Address:  bc1qds8uqnt4ga0zn9ftrm45cq9u9hfct0qluqes5a


RE: Python Selenium Help #3
(02-10-2021, 12:54 PM)DedSpace Wrote:
(02-10-2021, 03:40 AM)Einsatzgruppe Wrote: so long story short is there a way i can code it to auto clean google-cookie file out itself?? Or is that impossible ? from the basic research i did everyone just said introduce a sleep  witch yes in the short run it will have an impact  but the file will still fill up just will take longer  and ill be stuck in the same boat

Hello. Since you do not want to use time.sleep() I would suggest something along the lines of:

Code:
from os import remove try:     remove(path_to_file) except OSError:     pass

This is what I get when trying to delete a non existent file:

Code:
>>> from os import remove >>> remove("12345.txt") Traceback (most recent call last):   File "<stdin>", line 1, in <module> OSError: [Errno 2] No such file or directory: '12345.txt' >>> try: ...    remove("12345.txt") ... except OSError: ...    pass ... >>>

Using the try and except is necessary is you do not want to wait for the file to be created or if you do not know how long it takes to be created after deleting.
do you think in sleep ? im open to it if you think it should be added . Because 90% time its running in the background .. so id love for it to stay stable .. when first started it i kept getting stupid timeout sh*t -_- i was able to fix that .. But truly thank you soo much for helping me out <3 im about to try it out and will let you know the outcome!!!! again THANK YOU sooo much Sir


RE: Python Selenium Help #4
You don't have to use sleep if you have some sort of loop you can put the try and except in. Each iteration of the loop it will try to delete the file and if the file does not exist it will do nothing
Code:
  _______              _   _________   \      \            | | /        /   |      | _____  ____| | |   ____/ _____  _____  _____  _____   |   |  |/  _  \/      | \____   |/     \/     \/  ___\/  _  \   |      |    __/|  |   |/        |   |  |   |   \  \__ |   __/  /_______/\_____/\____|_/________/|  ____/\_____|_\____/\_____/                                   | |                                   |_/                         BTC Address:  bc1qds8uqnt4ga0zn9ftrm45cq9u9hfct0qluqes5a


RE: Python Selenium Help #5
i have some other questions about python stuff would it be alright if i asked about and you could answer them when you have some free time ?


RE: Python Selenium Help #6
(02-11-2021, 11:46 PM)Einsatzgruppe Wrote: i have some other questions about python stuff would it be alright if i asked about  and you could answer them when you have some free time ?

Of course. But perhaps you should open a new thread or PM me.
Code:
  _______              _   _________   \      \            | | /        /   |      | _____  ____| | |   ____/ _____  _____  _____  _____   |   |  |/  _  \/      | \____   |/     \/     \/  ___\/  _  \   |      |    __/|  |   |/        |   |  |   |   \  \__ |   __/  /_______/\_____/\____|_/________/|  ____/\_____|_\____/\_____/                                   | |                                   |_/                         BTC Address:  bc1qds8uqnt4ga0zn9ftrm45cq9u9hfct0qluqes5a


RE: Python Selenium Help #7
u should use requests library or other libraries that arent selenium, selenium is rather weird to work with, requests is a lot easier


RE: Python Selenium Help #8
This thread Is over a year old, and the OP has been banned.

Obviously he/she Is not active to read replies to the said request.
Thread closed.
[Image: AD83g1A.png]








Users browsing this thread: