Python Selenium - how to change HTML attribute

Python Selenium - how to change HTML attribute

Hi,

I need to change the attribute of the HTML element. For example, I have an element:

< input id="xyz" name="count" value="5" >

and I want to use Python Selenium to set the value to 33 as follows:

< input id="xyz" name="count" value="33" >

REPLY


Hi,

Using Python Selenium, you can change the HTML attribute as follows:

document.getElementById('xyz').setAttribute('value', '33')

Související obsah

linux

python

selenium

web

html

scraping

Komentáře

Vaše reakce na Python Selenium - jak změnit atribut HTML elementu?

Reference

Podívejte se na naše reference

Prohlédnout

Aplikace

Podívejte se na naše aplikace

Prohlédnout

Co umíme?

Podívejte se co umíme

Prohlédnout

Co umíme?

Vytváříme sofistikované aplikace pro náročné

Od webových aplikací přes android až po převodové můstky či složité informační systémy.

Podívejte se k nám

Máte ještě čas? Podívejte se na další rubriky

Tento web používá soubory cookie. Dalším procházením tohoto webu vyjadřujete souhlas s jejich používáním.. Více informací zde.