A..
A..

Reputation: 37

Selenium Python - extract Javascript as string

Can I extract JavaScript code using Python Selenium, In other words, i need the js code as string

function validateForm() {
  var x = document.forms["myForm"]["Password"].value;
  if (x.length >= 6) {
    
  }
}

Upvotes: 0

Views: 161

Answers (1)

user11025130
user11025130

Reputation:

you can use BeautifulSoup

soup = BeautifulSoup(response.content,'html.parser')
script_code = soup.find('script')

Upvotes: 1

Related Questions