ai客服
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
1.0 KiB

1 month ago
  1. import sys
  2. def optimize_scroll():
  3. with open('/Users/getmind/ds/kf/erp_automation.py', 'r') as f:
  4. content = f.read()
  5. # Place 1
  6. old_code_1 = """ row_text = row.inner_text(timeout=2000)
  7. try:
  8. row_html = row.inner_html(timeout=2000)
  9. except:
  10. row_html = "" """
  11. new_code = """ try:
  12. row_text = row.evaluate("el => el.innerText")
  13. row_html = row.evaluate("el => el.innerHTML")
  14. except:
  15. row_text = ""
  16. row_html = "" """
  17. content = content.replace(old_code_1, new_code)
  18. with open('/Users/getmind/ds/kf/erp_automation.py', 'w') as f:
  19. f.write(content)
  20. if __name__ == '__main__':
  21. optimize_scroll()