diff --git a/README.md b/README.md index b6f8604..77e4139 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,30 @@ -# Python repo template -[](https://GitHub.com/Lerking/python-repo-template/forks/) -[](https://GitHub.com/Lerking/python-repo-template/stargazers/) -[](https://GitHub.com/Lerking/python-repo-template/watchers/) +# Python web scraping examples +[](https://GitHub.com/Lerking/web-scraping-python/forks/) +[](https://GitHub.com/Lerking/web-scraping-python/stargazers/) +[](https://GitHub.com/Lerking/web-scraping-python/watchers/) [](https://www.python.org/) -[](https://github.com/Lerking/python-repo-template) +[](https://github.com/Lerking/web-scraping-python) -[](https://GitHub.com/Lerking/python-repo-template.github.io/graphs/commit-activity) -[](https://GitHub.com/Lerking/python-repo-template/graphs/contributors/) +[](https://GitHub.com/Lerking/web-scraping-python.github.io/graphs/commit-activity) +[](https://GitHub.com/Lerking/web-scraping-python/graphs/contributors/) -[]() +[]() -[](https://GitHub.com/Lerking/python-repo-template/issues/) -[](https://GitHub.com/Lerking/python-repo-template/issues?q=is%3Aissue+is%3Aclosed) -[](http://isitmaintained.com/project/Lerking/python-repo-template "Percentage of issues still open") -[](http://isitmaintained.com/project/Lerking/python-repo-template "Average time to resolve an issue") +[](https://GitHub.com/Lerking/web-scraping-python/issues/) +[](https://GitHub.com/Lerking/web-scraping-python/issues?q=is%3Aissue+is%3Aclosed) +[](http://isitmaintained.com/project/Lerking/web-scraping-python "Percentage of issues still open") +[](http://isitmaintained.com/project/Lerking/web-scraping-python "Average time to resolve an issue") -[](https://GitHub.com/Lerking/python-repo-template/pull) -[](https://GitHub.com/Lerking/python-repo-template/pull) +[](https://GitHub.com/Lerking/web-scraping-python/pull) +[](https://GitHub.com/Lerking/web-scraping-python/pull) Coding time for this reposotory. -[](https://wakatime.com/badge/user/d43f2852-fd6f-45b4-b713-558ad18204d4/project/dcf411f9-6d3e-4b14-9290-5ed419cf4012) +[](https://wakatime.com/badge/user/d43f2852-fd6f-45b4-b713-558ad18204d4/project/6b4d8af5-fd7e-4935-8116-60b9b13b44e3) See the wiki for usage and examples. -[python-repo-template wiki page](https://github.com/Lerking/python-repo-template/wiki) +[web-scraping-python wiki page](https://github.com/Lerking/web-scraping-python/wiki) Visitors since repo creation. - \ No newline at end of file + \ No newline at end of file diff --git a/main.py b/main.py deleted file mode 100644 index e69de29..0000000 diff --git a/mechanicalsoup_example.py b/mechanicalsoup_example.py new file mode 100644 index 0000000..f73eb01 --- /dev/null +++ b/mechanicalsoup_example.py @@ -0,0 +1,19 @@ +import mechanicalsoup + +def main(): + browser = mechanicalsoup.StatefulBrowser() + browser.open("https://www.sas.dk/book/flights/?search=RT_CPH-NYC-20230521-20230528_a1c0i0y0&view=upsell&bookingFlow=points&sortBy=rec,rec&filterBy=all,all&out_class=BUSINESS&out_sub_class=SAS%20BUSINESS%20PRO&out_flight_number=SK1462,SK907") + + #offers = browser.page.find('td', class_='slide-plus up-grid-prods flight-products') + #offers = browser.page.find_all('span', class_='fareprice-ubc') + offers = browser.page.find_all('link') + print(browser.get_url()) + print(browser.get_current_page().title.text) + #print(browser.page) + print(offers) + +if __name__ == "__main__": + main() + ''' +