Advertisement
andrzej321

Untitled

Nov 19th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. driver.execute_script("""var url = `https://m.aliexpress.com/api/order/place`;
  2. # var data = new URLSearchParams({
  3. # payMethod: 'others',
  4. # subPayMethod: 'others',
  5. # paymentGateway: 'ALIPAY',
  6. # currency: 'USD',
  7. # orderFrom: 'msiteShopcart',
  8. # orderType: 'Normal',
  9. # timeZone: '-120',
  10. # selectedAddressId: """ + str(dupa) + """,
  11. # country: 'CZ',
  12. # productJsonString: JSON.stringify([
  13. # {
  14. # productId: '4000083214503',
  15. # productUniqueKey: '4000083214503',
  16. # skuAttr: '14:193',
  17. # quantity: '1',
  18. # serviceName: 'POST_NL',
  19. # orderMemo: ''
  20. # }
  21. # ]),
  22. # payAction: 'switchChannel',
  23. # aeCouponId: '',
  24. # useShoppingCoupon: false,
  25. # haveAcrossStoreSelectCoupon: false
  26. # }).toString();
  27. #
  28. # var params = {
  29. # body: data,
  30. # method: 'POST',
  31. # headers: {
  32. # cookie: document.cookie,
  33. # 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'
  34. # }
  35. # };
  36. #
  37. # fetch(url, params)
  38. # .then(data => {
  39. # return data.json();
  40. # })
  41. # .then(res => {
  42. # console.log(res);
  43. # console.log('OrderID:', res.data.placeOrderResult.orderIds[0]);
  44. # console.log('Timestamp:', res.data.placeOrderResult.timeStamp);
  45. # console.log('payToken:', res.data.placeOrderResult.payToken);
  46. # console.log('contractIds:', res.data.contractIds);
  47. # });""")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement