0

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) {
    
  }
}
A..
  • 37
  • 6

1 Answers1

1

you can use BeautifulSoup

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