import sys

sys.path.append('..')
import reusables

soup = reusables.scrape(
    "https://www.ebay.com/sch/i.html?_odkw=gt350+wheel+stock+oem+factory+10053&_udhi=340&_mPrRngCbx=1&LH_BIN=1&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR0.TRC0.H0.Xgt350+wheel+stock+oem+factory+10053+-lexus.TRS0&_nkw=gt350+wheel+stock+oem+factory+10053+-lexus&_sacat=0"
)

for item in soup.find_all("li", {"class": "sresult"}):
    a = item.find_all("a")[0]
    href = a.get("href")

    reusables.check_href_and_send_notification("New GT350 Wheel Match!", "",
                                               href)
        type_of_flight = matches.group(3)
        origin = matches.group(4)
        destination = matches.group(5)
        cost = matches.group(6)
        connection = matches.group(7)
        timeframe = matches.group(8)
        additional_info_separated_by_sentences = matches.group(9)

        # cardTitle = 'Flight to ' + destination + ' in ' + timeframe + ' for ' + cost
        cardDescription = ("#[Original Post](" + href + ")"
                           "\n\n**Origin**: " + origin + ""
                           "\n**Destination**: " + destination + ""
                           "\n**Cost**: " + cost + ""
                           "\n**Type**: " + type_of_flight + ", " +
                           connection + ""
                           "\n**Timeframe**: " + timeframe + ""
                           "\n\n" + additional_info_separated_by_sentences +
                           "")

        if href not in reusables.get_hrefs():
            requests.post("https://en1wwvea98k42yd.m.pipedream.net/", {
                "boardName": "Reading Material 📕",
                "listName": "News",
                "cardName": title,
                "cardDescription": cardDescription
            },
                          timeout=30)
            reusables.add_href(href)
    else:
        reusables.check_href_and_send_notification("New Flight Deal!", desc,
                                                   href)
Ejemplo n.º 3
0
import sys
sys.path.append('..')
import reusables

soup = reusables.scrape("https://houston.craigslist.org/search/sss?query=ipad+air+2&sort=rel&srchType=T&hasPic=1&search_distance=50&postal=77081&min_price=100&max_price=200")

for item in soup.find_all("li", {"class":"result-row"}):
    a = item.find_all("a")[0]
    href = a.get("href")

    reusables.check_href_and_send_notification("New iPad Craigslist Match!", href, href)
import sys
sys.path.append('..')
import reusables

#soup = reusables.scrape("https://www.ebay.com/sch/i.html?_udlo=100&_udhi=240&LH_BIN=1&_mPrRngCbx=1&_from=R40&_sacat=0&_nkw=ipad%205th%20generation%20-mini%20-broken%20-air%20space%20gray%20-dent&rt=nc")
#soup = reusables.scrape("https://www.ebay.com/sch/i.html?_udlo=100&_udhi=190&LH_BIN=1&_mPrRngCbx=1&_from=R40&_sacat=0&_nkw=ipad%20air%202%20new%20-mini%20-case%20-screen%20-keyboard%20-cover%20-hardcase%20-stand%20-sleeve%20-adapter%20-battery%20-frame&rt=nc")
soup = reusables.scrape("https://www.ebay.com/sch/i.html?_odkw=ipad+5th+generation+-aXtion+-keyboard+-mount+-digitizer+-replacement+-screen+-broken+-case&_udlo=116&_udhi=200&_mPrRngCbx=1&LH_BIN=1&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR0.TRC0.H0.Xipad+5th+generation+-aXtion+-keyboard+-mount+-digitizer+-replacement+-screen+-b.TRS0&_nkw=ipad+5th+generation+-aXtion+-keyboard+-mount+-digitizer+-replacement+-screen+-broken+-case+-locked&_sacat=0")

for item in soup.find_all("li", {"class":"sresult"}):
    a = item.find_all("a")[0]
    href = a.get("href")

    reusables.check_href_and_send_notification("New iPad eBay Match!", href, href)