Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

228
Views
Quiero enviar solicitudes JS POST usando Selenium, pero las nuevas XMLHttprequests en JS no están definidas

He estado buscando en Google y leyendo MDN, y probando diferentes cosas, y todavía no puedo hacer que funcione. ¿Alguien puede ayudar con esto? ¿Por qué causa tal problema?

 js = ''' var xhr = new XMLHttpRequest(); xhr.open('POST', 'https://www.ti.com.cn/occservices/v2/ti/addtocart', false); xhr.setRequestHeader('Content-type', 'application/json'); xhr.send('{"cartRequestList":[{"packageOption":null,"opnId":"%s","quantity":"%d","tiAddtoCartSource":"store-pdp","dienCode":"","year":"","week":"","batchCode":"","pcrCode":"","sparam":""}],"currency":"CNY"}'); return xhr.response;''' % (product['opn'], product['num']) js = js.replace(" ", "").replace("\n", "") resp = driver.execute_script(js) return resp
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!