Comments (4)
Does using this function works
import subprocess
import platform
def kill_process_by_pid(pid):
if pid is None:
raise ValueError("A PID must be provided")
os_name = platform.system()
try:
if os_name == 'Windows':
subprocess.run(['taskkill', '/PID', str(pid), '/F'], check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
else: # macOS and Linux share the same command for killing a process by PID
subprocess.run(['kill', str(pid)], check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
except subprocess.CalledProcessError:
print(f"Process with PID {pid} could not be terminated or does not exist.")
except Exception as e:
print(f"An error occurred while trying to kill the process with PID {pid}: {e}")
# Example usage:
# kill_process_by_pid(driver.service.process.pid) # Replace 12345 with the actual PID you want to kill
Also, let me know is the issue due to stealth driver only, or normal driver works fine?
from botasaurus.
Related Issues (20)
- Adding Brave HOT 1
- a doubt HOT 3
- When downloading a binary file like pdf the content is some kind of unicode encoded and cannot be decoded. HOT 3
- python -m pip install botasaurus returning error HOT 5
- Chrome failed to start error on ubuntu 22.04 server, p3.10 HOT 2
- Extension path HOT 1
- Cloudflare Failed HOT 1
- profile not work HOT 4
- Docker build error HOT 1
- 🌉 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'got-scraping-export' imported from /.............../site-packages/javascript/js/deps.js HOT 1
- unknown error: session deleted because of page crash HOT 3
- 🙏 Guidance on how to integrate Botasaurus in an existing project HOT 1
- How do I connect extensions and save all the settings? HOT 1
- Mail Verification (how can i use startswith for mails ?) HOT 1
- Integrating with flask and handling routes HOT 2
- OSError: [Errno 8] Exec format error HOT 2
- Please help me to download mp3 from a site. HOT 3
- Unable to pass cloudflare challenge HOT 2
- Can not download driver when running parallel
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from botasaurus.