Skip to content

Commit

Permalink
replace variables
Browse files Browse the repository at this point in the history
  • Loading branch information
NaiboWang committed Jul 22, 2023
1 parent 8c3a613 commit c9eb5b0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ExecuteStage/easyspider_executestage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,9 @@ def loopExecute(self, node, loopValue, clickPath="", index=0):
break
elif int(node["parameters"]["loopType"]) == 3: # 固定文本列表
textList = node["parameters"]["textList"].split("\n")
if len(textList) == 1: # 如果固定文本列表只有一行,现在就可以替换变量
textList = replace_field_values(
node["parameters"]["textList"], self.outputParameters).split("\n")
for text in textList:
text = replace_field_values(text, self.outputParameters)
# self.recordLog("当前循环文本|Current loop text:", text)
Expand All @@ -1092,6 +1095,9 @@ def loopExecute(self, node, loopValue, clickPath="", index=0):
# tempList = node["parameters"]["textList"].split("\r\n")
urlList = list(
filter(isnotnull, node["parameters"]["textList"].split("\n"))) # 去空行
if len(urlList) == 1: # 如果固定网址列表只有一行,现在就可以替换变量
urlList = replace_field_values(
node["parameters"]["textList"], self.outputParameters).split("\n")
# urlList = []
# for url in tempList:
# if url != "":
Expand Down Expand Up @@ -1516,7 +1522,7 @@ def get_content(self, p, element):
content = select_element.first_selected_option.text
except:
content = ""
elif p["contentType"] == 14: # 元素属性值
elif p["contentType"] == 14: # 元素属性值
attribute_name = p["JS"]
try:
content = element.get_attribute(attribute_name)
Expand Down

0 comments on commit c9eb5b0

Please sign in to comment.