已解决Exception ignored in: <bound method Popen.__del__ of <subprocess.Popen object at 0x00000194C27C4B

已解决Exception ignored in: <bound method Popen.__del__ of <subprocess.Popen object at 0x00000194C27C4BE0>>
Traceback (most recent call last):
File “D:\ProgramData\Anaconda3\lib\subprocess.py”, line 768, in __del__
self._internal_poll(_deadstate=_maxsize)
File “D:\ProgramData\Anaconda3\lib\subprocess.py”, line 1035, in _internal_poll
if _WaitForSingleObject(self._handle, 0) == _WAIT_OBJECT_0:
OSError: [WinError 6] 句柄无效。









Error report



A small partner in the VIP full-stack Q&A group of thousands of people came to private message me when he encountered a problem, and wanted to use selenium to call the browser, but an error occurred (at that time, his heart was cold for a moment, and he came to me for help, and then it went smoothly. Help him solve it, and record it by the way, hoping to help more friends who encounter this bug and will not solve it), the error code is as follows:

from selenium.webdriver.chrome.options import Options
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By

def get_data(Rid,StoreID,GoodsUrl):
    chrome_options = Options()
    chrome_options.add_experimental_option("debuggerAddress", "127.0.0.1:9222")  # 通过端口号接管已打开的浏览器
    driver = webdriver.Chrome(options=chrome_options)
    # driver.maximize_window()
    # url = 'https://pifa.pinduoduo.com/goods/detail/?gid=253831597763'
    driver.get(GoodsUrl)

    print(driver.title)

A screenshot of the content of the error message is as follows :


insert image description here




error translation



The translation of the error message content is as follows :


Exception ignored in: <bound method Popen__ del__ of <subprocess.Popen object at 0x00000194C27C4BE0>>

Trace (last call last):

File "D:\ProgramData\Anaconda3\lib\subprocess.py", line 768, in __del__

自我_internal_poll(_deadstate=_maxsize)

File "D:\ProgramData\Anaconda3\lib\subprocess.py", line 1035, in _internal_poll

如果_WaitForSingleObject(self._handle,0)==_WAIT_OBECT_0:

OS error: [WinError 6]





Error reason



This error occurs for two reasons :

第一种是使用driver后没有关闭

第二种使用使用了driver.close()



Solution



When closing the driver, use driver.quit()instead of driver.close().

The above is the solution to the cause of this error. Welcome to leave a message in the comment area to discuss whether it can be solved.If it is useful, please like and collect the article. Thank you for your support. The blogger has the motivation to keep recording the problems encountered.!!!

Thousands of full-stack VIP Q&A group to contact bloggers to help solve errors

Due to the limited time and energy of bloggers, there are too many private messages every day, and there is no way for every fan to reply in time, so reply to VIP fans first, and you can enter the thousand-person full stack by subscribing to the time-limited 9.9 paid column "100 Days Mastering Python from Getting Started to Employment" VIP answering group, get priority answering opportunities (code guidance, remote service), free prostitution 80G learning materials spree, column subscription address: https://blog.csdn.net/yuan2019035055/category_11466020.html

  • Advantages :The author gives priority to answering opportunities (code guidance, remote service), and many bigwigs in the group can hold together to keep warm (big factory internal promotion opportunities). This column is a complete set of teaching specially prepared for students with zero foundation and those who need advanced improvement , From 0 to 100, continue to advance and deepen, and there will be practical projects in the follow-up, so you can easily deal with interviews!

  • Column benefits :Resume guidance, internal referral for recruitment, weekly delivery of physical books, 80G full-stack learning videos, 300 IT e-books: Python, Java, front-end, big data, database, algorithm, crawler, data analysis, machine learning, interview question bank, etc.

  • Note : If you want to get a timely reply, communicate and learn with the big guys, after subscribing to the column, private message the blogger to enter the VIP Q&A group with thousands of peopleinsert image description here
    insert image description here

Free information acquisition, more fan benefits, follow the official account below to obtain

insert image description here

Guess you like

Origin blog.csdn.net/yuan2019035055/article/details/130626852