FB Marketplace crawler
This commit is contained in:
parent
ff9a059a35
commit
8723a732cb
|
@ -68,10 +68,23 @@ class FbMarketplaceProducts:
|
|||
products = []
|
||||
for element in product_elements:
|
||||
try:
|
||||
name = element.find_element(By.CSS_SELECTOR, ".x1lliihq.x6ikm8r.x10wlt62.x1n2onr6").text
|
||||
price = element.find_element(By.CSS_SELECTOR, ".x193iq5w.xeuugli.x13faqbe.x1vvkbs.xlh3980.xvmahel.x1n0sxbx.x1lliihq.x1s928wv.xhkezso.x1gmr53x.x1cpjm7i.x1fgarty.x1943h6x.x4zkp8e.x3x7a5m.x1lkfr7t.x1lbecb7.x1s688f.xzsf02u").text
|
||||
try:
|
||||
name = element.find_element(By.CSS_SELECTOR, ".x1lliihq.x6ikm8r.x10wlt62.x1n2onr6").text
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
price = element.find_element(By.CSS_SELECTOR, ".x193iq5w.xeuugli.x13faqbe.x1vvkbs.x10flsy6.x1lliihq.x1s928wv.xhkezso.x1gmr53x.x1cpjm7i.x1fgarty.x1943h6x.x1tu3fi.x3x7a5m.x1lkfr7t.x1lbecb7.x1s688f.xzsf02u").text
|
||||
except:
|
||||
pass
|
||||
|
||||
url = element.find_element(By.TAG_NAME, 'a').get_attribute("href")
|
||||
city = element.find_element(By.CSS_SELECTOR, ".x1lliihq.x6ikm8r.x10wlt62.x1n2onr6.xlyipyv.xuxw1ft").text
|
||||
|
||||
try:
|
||||
city = element.find_element(By.CSS_SELECTOR, ".x1lliihq.x6ikm8r.x10wlt62.x1n2onr6.xlyipyv.xuxw1ft").text
|
||||
except:
|
||||
pass
|
||||
|
||||
flag = 0
|
||||
product = [name, price, url, city, flag]
|
||||
products.append(product)
|
||||
|
|
Loading…
Reference in New Issue