Python

Room rules: sopython.com/chatroom Code formatting guide: tinyu...
Jun 27, 2018 23:31
I'm still a little confused on what link extractors are used for
Jun 27, 2018 23:30
hi, anyone familiar with scrapy?
Jun 26, 2018 21:20
@DSM sorry for the late response - I'm trying to extract the "Monta Vista" near the top of the page.
Jun 26, 2018 20:30
sorry I missed the backticks: '//*[@id="anetMain"]/div[3]/team-nav/div/div/team-nav-logo/div/div/h1/a/text()'‌​
Jun 26, 2018 20:29
ok, read them. i'm trying to use scrapy to gather the school name from this site: athletic.net/TrackAndField/Athlete.aspx?AID=7844096#!/L4. I tried using inspect element to copy the XPath, but response.xpath('//*[@id="anetMain"]/div[3]/team-nav/div/div/team-nav-logo/div/di‌​v/h1/a/text()') returns an empty array for me. am I missing something?
Jun 26, 2018 20:26
hi, is this a place where I could ask a question? I posted a thread but the only person who responded couldn't figure it out
 
Jun 26, 2018 20:27
will do
Jun 26, 2018 20:26
ok i'll try and figure it out then - thanks for your help
Jun 26, 2018 20:26
hmm
Jun 26, 2018 20:24
hello?
Jun 26, 2018 20:20
but I'm still getting an empty array when I add /text()
Jun 26, 2018 20:19
Hi, I didn't want to clutter the thread with my comments anymore
Jun 26, 2018 20:19
Sorry if these are stupid questions, I'm very new here - but replacing that line still returns an empty array.
Jun 26, 2018 20:19
Oh, that's a helpful tip! But I'm getting another "invalid syntax" error when I tried running 'school_name' : response.xpath("//*[@id="anetMain"]/div[3]/team-nav/div/div/‌​team-nav-logo/div/‌​di‌​v/h1/a").extract_fir‌​st()
Jun 26, 2018 20:19
Oh my god, thank you that was stupid. But the second line still returns an empty array instead of the school name - is there something else missing?