problem
TypeError: ‘WebElement’ object is not iterable error
solve
At first, I thought it was an element problem. Later, I looked at the method carefully because
find should be used_ elements_by_XPath
instead of find_element_by_xpath
for citys in driver.find_elements_by_xpath('/html/body/div[6]/dl'):
instead of
for citys in driver.find_element_by_xpath('/html/body/div[6]/dl'):
Read More:
- [Solved] MongoDB Error: TypeError: Object of type ObjectId is not JSON serializable
- Taro Use React Hooks Error: TypeError: Object(…) is not a function
- Webpack packaging error TypeError: this.getOptions is not a function at Object.lessLoader
- Syntax Error: TypeError: this.getOptions is not a function
- TypeError: db.collection is not a function
- TypeError: res.render is not a function
- Resolve InsecurePlatformWarning: A true SSLContext object is not available.
- [Fixed] Typeerror: error 1009: Cannot access properties or methods referenced by an empty object
- Django Error: ‘set‘ object is not reversible [How to Solve]
- Webpack Error: Module build failed: TypeError: this.getOptions is not a function
- [Solved] Error: ‘attrition‘ is not an exported object from ‘namespace:rsample‘
- [Solved] Postcss Error: Invalid options object. PostCSS Loader has been initialized using an options object that does not match the API schema.
- AUC Error – ValueError: Data is not binary and pos_label is not specified
- The uibot database connection is unrecognized error: The object definition error
- Abnormal [System.InvalidOperationException: custom type mapping for ‘xxx’ is not specified or is not a solution
- Android integration of iFLYTEK’s speech recognition (voice dictation) error message “Failed to create the object, please confirm that libmsc.so is placed correctly, and createUtility is called to initialize”
- IDEA reports an error Could not reserve enough space for xxxxKB object heap processing
- JSON parse error: Can not deserialize instance of java.lang.String out of START_OBJECT token
- Error occurred during initialization of VM Could not reserve enough space for 1572864KB object heap