티스토리 뷰
def TreatSubTag(self, elemIn, paramIn):
tagProperty = paramIn.get('TagProperty')
tagType = paramIn.get('TagType')
tagValue = paramIn.get('TagValue')
tagProperty = paramIn.get('TagProperty')
valueID = paramIn.get('ValueID')
attrib = paramIn.get('Attribute')
subTags = paramIn.get('SubTag_s')
rst1DF = DataFrame()
if not tagProperty:
print("[?] None of Tag Property")
return
if tagProperty == "Bundles":
elems1 = self.GetElements(elemIn, tagType, tagValue)
if not elems1:
return
for elem11 in elems1:
if str(type(subTags))=="<class 'list'>":
for subTag in subTags:
res1 = self.TreatSubTag(elem11, subTag)
rst1DF = rst1DF.append(res1, ignore_index=True)
elif str(type(subTags))=="<class 'dict'>":
res1 = self.TreatSubTag(elem11, subTags)
rst1DF = rst1DF.append(res1, ignore_index=True)
else:
print("[?] Wrong Type of SubTags")
elif tagProperty=="Bundle":
elem1 = self.GetElement(elemIn, tagType, tagValue)
if not elem1:
return
if str(type(subTags))=="<class 'list'>":
for subTag in subTags:
res1 = self.TreatSubTag(elem1, subTag)
rst1DF = rst1DF.append(res1, ignore_index=True)
elif str(type(subTags))=="<class 'dict'>":
res1 = self.TreatSubTag(elem1, subTags)
rst1DF = rst1DF.append(res1, ignore_index=True)
else:
print("[?] Wrong Type of SubTags")
elif tagProperty == "Items":
elems1 = self.GetElements(elemIn, tagType, tagValue)
if not elems1:
return
for elem11 in elems1:
if str(type(subTags))=="<class 'list'>":
for subTag in subTags:
res1 = self.TreatSubTag(elem11, subTag)
if not res1.empty: rst1DF = rst1DF.append(res1, ignore_index=True)
elif str(type(subTags))=="<class 'dict'>":
res1 = self.GetItemValue(elem11, subTags)
if not res1.empty: rst1DF = rst1DF.append(res1, ignore_index=True)
else:
print("[?] Wrong Type of SubTags")
print(rst1DF)
elif tagProperty=="aItem":
if str(type(subTags))=="<class 'list'>":
for subTag in subTags:
res1 = self.TreatSubTag(elem11, subTag) # subTag <== aItem
if not res1.empty: rst1DF = rst1DF.append(res1, ignore_index=True)
elif str(type(subTags))=="<class 'dict'>":
res1DF = self.GetItemValue(elem11, subTags) # subTag <== ItemValue
if not res1.empty: rst1DF = rst1DF.append(res1, ignore_index=True)
else:
print("[?] Wrong Type of SubTags")
return rst1DF
반응형
'SWDesk' 카테고리의 다른 글
[Python] Testing ... DataFrame (0) | 2022.05.31 |
---|---|
[Python] PickNewItems - TreatPage() (0) | 2022.05.29 |
[Python] PickNewItems - GetItemValue() (0) | 2022.05.26 |
[Python] Data Addition after Initialization (0) | 2022.05.23 |
[Python] Stock Trade (0) | 2022.04.12 |
반응형
250x250
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 전압
- 오블완
- 심심풀이치매방지기
- Video
- badp
- Innovations&Hurdles
- 허들
- Innovations
- 둎
- 티스토리챌린지
- arduino
- Innovation&Hurdles
- 혁신과허들
- image
- DYOV
- BSC
- bilient
- 아두이노
- Hurdles
- 심심풀이
- 전압전류모니터링
- 빌리언트
- Decorator
- 치매방지
- 치매
- 혁신
- 전류
- 절연형
- ServantClock
- 배프
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
글 보관함