我正在尝试抓取我感兴趣的页面。为此,我需要从 HTML 中删除元素的属性。'style' 是我想要删除的。所以我从 Stackoverflow 中找到了一些代码。(我使用 Chrome 作为驱动程序)
element = driver.find_element_by_xpath("//select[@class='m-tcol-c' and @id='searchBy']")
driver.execute_script("arguments[0].removeAttribute('style')", element)
代码中的arguments[0] 有什么作用?谁能具体解释arguments[0]的作用?
慕莱坞森
智慧大石
相关分类