我正在尝试找出一种方法来打破长 for 循环,使其 PEP-8 有效。 (我正在使用 flake8 vscode 扩展)。
这是代码:
for result_row in soup.find_all('div', {"class": "b2c-inner-data-wrapper"}):
..............
我得到的错误是:
line too long (88 > 79 characters)
我已经尝试过:
for result_row in soup.find_all('div',
{"class": "b2c-inner-data-wrapper"}):
但我明白:
continuation line under-indented for visual indent
正确的做法是什么? 谢谢。
result_rows = soup.find_all('div', {"class": "b2c-inner-data-wrapper"})
for result_row in result_rows:
..............
for result_row in soup.find_all(
'div',
{"class": "b2c-inner-data-wrapper"}
):