Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link to every item in email #2

Open
rkantos opened this issue Dec 11, 2017 · 3 comments
Open

Link to every item in email #2

rkantos opened this issue Dec 11, 2017 · 3 comments

Comments

@rkantos
Copy link

rkantos commented Dec 11, 2017

The script seems to work nicely.. However I'd like one addition to the parser. It should add link for every item that it sends in an email, since the item can already be removed by the time one goes to go to look at the email info. This would save time wondering for missing results in the search page.

@pkronstrom
Copy link
Owner

Thank you for the suggestion!
I'll add it on my todo-list ;)

Feel free to do a pull-request, if you feel like it!

@rkantos
Copy link
Author

rkantos commented Dec 19, 2017

What is this part supposed to do? What does the url signify in it? (pardon me, but don't really have experience with python..)

		titles = {} # title as key, url as value

		for item in temp:
			tag = item.find("a")
			name = tag.text
			titles[name] = tag['href']

		return titles

@pkronstrom
Copy link
Owner

pkronstrom commented Dec 19, 2017

This part constructs a dictionary of Tori.fi auction links.

The variable temp here contains a list of html divs from a search page, which are looped through to save both the inner text and url of items with a link (html tag ).

The dict titles might look something like this:
{ 'Joulukuusi': 'https://www.tori.fi/varsinais-suomi/Joulukuusi_42863360.htm?ca=18&w=3', 'Joulukuusi Lahjakortti': 'https://www.tori.fi/uusimaa/Joulukuusi_Lahjakortti__42862388.htm?ca=18&w=3'}

`
titles = {} # title as key, url as value

	for item in temp: # list of <div> wrapper elements
		tag = item.find("a") # find a link from the wrapper
		name = tag.text # save the title
		titles[name] = tag['href'] # save the link (as a dict entry)

	return titles

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants