Files
python-bootcamp/__pycache__/fp2_14.cpython-311.pyc
T

72 lines
12 KiB
Plaintext
Raw Normal View History

§
`md!6ãól—ddlmZddlmZddlmZddlmZddlm Z ddl
Z
ddl Z ddl m
Z
ddlZddlmZdd lmZddlZddlZddlZddlZejgd
¢¬ ¦«Zed e›�¦«e¦«Ze d
¦«eje¬¦«ZdZ dZ!ej"¦«Z#e# $e e!¦«Z$dZ%e% &d¦«ddd…Z'ej(e )e%¦«d„Z*d„Z+d„Z,d„Z- e-¦«e+¦«d„Z. ej/ 0de$¬¦«Z1gZ2 e# 3e1¬¦«Z4e4j5Z2n #e$rYnwxYwe2r e.e2d¦«Zede›�¦«nede j6¦«›�¦«nŒ‡dS) é)Ú pubsub_v1)ÚDeadlineExceeded)Ú webdriver)ÚOptions)ÚByN)Ú TimeoutError)Ú
WebDriverWait)Úexpected_conditions©z
Product IDzZip Codez Shown PricezMinimum Quantityz Total Pricez
Unit Pricez Sales Countz Sold Status)ÚcolumnszCreated a dataframe: z
--disable-gpu)Úoptionsz fp-20230425zfp-subscription-NFL-zipcodeszmhttps://www.sayweee.com/en/product/House-Foods-Firm-Tofu-/85175?trace_id=c93f3d1a-80a4-4e1a-8d41-a402ae43186fú/éÿÿÿÿécóè—d}|dz
}|dz
}|dz
}|d|›d�z
} t tj|¦«}| d¦«S#t
jjj$r
}Yd}~nd}~wwxYwd}|dz
}|d z
}|d|›d
�z
} t tj|¦«}| d¦«S#t
jjj$r
}Yd}~nd}~wwxYwd S) aE
Return the text in the first element with a given class name.
Note that XPath doesn't have a function to check if a given word is present
in a list of words, so using contains() will match a class name even if
the class name is a substring of the class name being matched against.
To prevent this, we use spaces as a delimiter at the beginning and end of
the class name, and ensure there's only one space before and after all
class names in the class name list.
Example: consider two class names with cache-busting suffixes:
* Header_soldStatusNotice__12345
* Header_soldStatusNoticeBackground__ABCDE
Matching against Header_soldStatusNotice using a naive implementation with
`contains()` would match both class names, even though only the first one
is the correct match.
z
//*[contains(z concat(' ', znormalize-space(@class), z' '), z' z ')]Ú textContentNznormalize-space(@class)), z__')]Ú) ÚdriverÚ find_elementrÚXPATHÚ
get_attributeÚseleniumÚcommonÚ
exceptionsÚNoSuchElementException)Úclass_name_prefixÚ xpath_strÚmatchÚnsees ú1c:\Users\Karen\git_Karen\Bootcamp_Karen\fp2_14.pyÚget_element_textr!*s=€ð( €IØ
�Ñ€IØ
Ð,Ñ,€IØ
�Ñ€IØ
Ð-Ð'Ð-Ð-Ð-Ñ-€Ið
Ý×#Ò#¥B¤H¨iÑ8Ô8ˆØ×"Ò" =Ñ1Ô1Ð1øÝ Œ?Ô %Ô <ð
ð
ð
Ø ˆˆˆˆøøøøð
øøøð  €IØ
�Ñ€IØ
Ð-Ñ-€IØ
Ð.Ð'Ð.Ð.Ð.Ñ.€Ið
Ý×#Ò#¥B¤H¨iÑ8Ô8ˆØ×"Ò" =Ñ1Ô1Ð1øÝ Œ?Ô %Ô <ð
ð
ð
Ø ˆˆˆˆøøøøð
øøøð ˆ2s#œ9AÁA9Á4A9Â9C à C/Ã*C/cóð— ttd¦« tjt
jdf¦«¦«}td|›�¦«| ¦«dS#YdSxYw)NézO//*[contains(concat(' ', normalize-space(@class), ' '), ' icon-icon-close-s ')]zmodal_close = © r rÚuntilÚECÚpresence_of_element_locatedrrÚprintÚclick)Ú modal_closes r r*r*ZsŒ€ð
Ý#¥F¨AÑ.Ô.×4Ò4µRÔ5SÕUWÔU]ð`qðUrñ6sô6sñtôtˆ Ý
Ð,˜{Ð,Ð,Ñ-Ô-Ð-Ø×ÒÑÔÐÐÐøð
Ø ˆˆøøøó ‚A,A0Á0A5cóÌ— ttd¦« tjt
jdf¦«¦«}| ¦«dS#YdSxYw)Nr#zD/html/body/div[3]/div/div[2]/div/div[2]/div/div/div[1]/div[2]/button)r rr%r&r'rrr))Ú notice_closes r r-r-bsu€ð
å$¥V¨QÑ/Ô/×5Ò5µbÔ6TÕVXÔV^ðagðVhñ7iô7iñjôjˆ à×ÒÑÔÐÐÐøð
Ø ˆˆøøøs ‚AAÁA#cóð— ttd¦« tjt
jdf¦«¦«}td|›�¦«| ¦«dS#YdSxYw)Nr#z./html/body/div[3]/div[2]/div/div/div[3]/buttonzcookie_button = r$)Ú
cookie_buttons r Ú cookie_closer0ks}€ð
Ý%¥f¨aÑ0Ô0×6Ò6Ý Ô *­B¬HÐ6fÐ+gÑ hÔ hñ
ô