Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: For Loop Returning 3 Results When There Should Be 1
Post: RE: For Loop Returning 3 Results When There Should...

Sorry Sam, I probably wasn't overly clear to address your full question. **confused** The reason I changed the code in the end to include the additional div (unlike the original code), was because ...
knight2000 General Coding Help 12 794 Sep-27-2021, 02:23 AM
    Thread: For Loop Returning 3 Results When There Should Be 1
Post: RE: For Loop Returning 3 Results When There Should...

(Sep-26-2021, 04:38 PM)SamHobbs Wrote: (Sep-26-2021, 11:05 AM)knight2000 Wrote: So I followed your suggestion to use lxml and tried the following code:In your fixed code you first find relevant di...
knight2000 General Coding Help 12 794 Sep-27-2021, 02:16 AM
    Thread: For Loop Returning 3 Results When There Should Be 1
Post: RE: For Loop Returning 3 Results When There Should...

Hi deanhystad, Thanks a lot for explaining it to me- I've read your reply a few times to try and understand it. **smile** I tried your code but I seem to have got an error: Error:if item['class_']...
knight2000 General Coding Help 12 794 Sep-26-2021, 11:14 AM
    Thread: For Loop Returning 3 Results When There Should Be 1
Post: RE: For Loop Returning 3 Results When There Should...

Hi snippsat, Thank you for your advice about not using soup when looping- I had tried over 30 different methods to get this data and most of them didn't use soup when looping, but by the end of all t...
knight2000 General Coding Help 12 794 Sep-26-2021, 11:05 AM
    Thread: For Loop Returning 3 Results When There Should Be 1
Post: RE: For Loop Returning 3 Results When There Should...

You're spot on Sam. After replying to you, I was mulling over it and realized that the 3 from your code definitely gave a clue as to why I was getting 3 results. (Sep-26-2021, 05:29 AM)SamHobbs Wro...
knight2000 General Coding Help 12 794 Sep-26-2021, 10:48 AM
    Thread: For Loop Returning 3 Results When There Should Be 1
Post: RE: For Loop Returning 3 Results When There Should...

Hi Sam, Thanks for chiming in. I tried your code and got: Output:3 <span class="w_A w_C w_B mr1 mt1 ph1">1-day shipping</span>It's still not reporting where it can't find 1 record (the...
knight2000 General Coding Help 12 794 Sep-26-2021, 04:24 AM
    Thread: For Loop Returning 3 Results When There Should Be 1
Post: For Loop Returning 3 Results When There Should Be ...

Hi Guys, After trying to figure this one out for over 8 hours, I thought I would get a fresh perspective from someone. I'm practicing some web scrapping and I've got a scenario where I've got a pre...
knight2000 General Coding Help 12 794 Sep-26-2021, 03:11 AM
    Thread: Getting All Items From A List
Post: RE: Getting All Items From A List

(Sep-25-2021, 12:40 AM)Yoriz Wrote: You can use string's join method as I have shown in the example above. Sorry Yoriz- just woke up and must be blind as a bat! I didn't see your code and thought yo...
knight2000 General Coding Help 4 434 Sep-25-2021, 12:56 AM
    Thread: Getting All Items From A List
Post: RE: Getting All Items From A List

Hi Yoriz, Yes please, as a single string with a space between each string item.
knight2000 General Coding Help 4 434 Sep-25-2021, 12:30 AM
    Thread: Getting All Items From A List
Post: Getting All Items From A List

Hey guys, In practicing some webscrapping with BeautifulSoup and Selenium. Using the find_all to extract a class, I get the following list: Output:['w_A', 'w_C', 'w_B', 'mr1', 'mt1', 'ph1']Here'...
knight2000 General Coding Help 4 434 Sep-24-2021, 11:31 AM
    Thread: Running A Loop Until You See A Particular Result
Post: RE: Running A Loop Until You See A Particular Resu...

(Sep-01-2021, 02:20 PM)DeaD_EyE Wrote: Hi DeaD_EyE, Sorry for such a delay in replying. In more testing of the original suggestion, I found that I was still having an issue (my oversight- but sti...
knight2000 General Coding Help 6 13,653 Sep-04-2021, 08:55 AM
    Thread: Running A Loop Until You See A Particular Result
Post: RE: Running A Loop Until You See A Particular Resu...

(Sep-01-2021, 12:15 PM)ibreeden Wrote: (Sep-01-2021, 10:18 AM)knight2000 Wrote: but the problem is that when it does find a working proxy (response = 200), it still continues to check every other ...
knight2000 General Coding Help 6 13,653 Sep-04-2021, 08:46 AM
    Thread: Running A Loop Until You See A Particular Result
Post: RE: Running A Loop Until You See A Particular Resu...

Hi Menator01, Thank you for taking the time to give me that detailed solution. I've never heard of the copy module so that was interesting to see. I did try various other attempts with 'try's' and 'i...
knight2000 General Coding Help 6 13,653 Sep-01-2021, 10:18 AM
    Thread: Running A Loop Until You See A Particular Result
Post: Running A Loop Until You See A Particular Result

Hi guys, I've been learning about rotating proxies and have found myself a little stuck and after many many hours have passed, I thought it was time to reach out for some assistance. **smile** In ...
knight2000 General Coding Help 6 13,653 Sep-01-2021, 06:23 AM
    Thread: Using Excel Cell As A Variable In A Loop
Post: RE: Using Excel Cell As A Variable In A Loop

Thank you. I was running small print statements as I was going to verify and everything looked good up until adding the last requests line. So the last print statement where everything was working ...
knight2000 General Coding Help 7 798 Aug-25-2021, 11:26 AM
    Thread: Using Excel Cell As A Variable In A Loop
Post: RE: Using Excel Cell As A Variable In A Loop

(Aug-23-2021, 10:15 AM)Yoriz Wrote: Try headers = {'User-Agent': random_header_variable} Thank you Yoriz. I gave that a go and good news is that I'm not getting any error message...bad news is tha...
knight2000 General Coding Help 7 798 Aug-24-2021, 01:38 AM
    Thread: Using Excel Cell As A Variable In A Loop
Post: RE: Using Excel Cell As A Variable In A Loop

Hi Bowlofred, Thanks for your suggestion- I understand what you're saying, but to be honest, I don't know how to go about applying that- particularly since I'm importing part of that as a variable. ...
knight2000 General Coding Help 7 798 Aug-23-2021, 09:49 AM
    Thread: Using Excel Cell As A Variable In A Loop
Post: Using Excel Cell As A Variable In A Loop

Hi all, As a relative newbie to Python and webscrapping, I've been trying to learn more about headers and proxies- in terms of rotating them from a excel list I've created. I've watched lots of diffe...
knight2000 General Coding Help 7 798 Aug-23-2021, 06:24 AM
    Thread: Extracting An Object
Post: RE: Extracting An Object

(Aug-07-2021, 11:33 AM)ndc85430 Wrote: Can you not just ask for the strings? https://www.crummy.com/software/Beautifu...ed-strings. Hi ndc85430, I did have a look at that (thank you for the link) ...
knight2000 General Coding Help 5 593 Aug-08-2021, 08:48 AM
    Thread: Extracting An Object
Post: RE: Extracting An Object

Hi Snippsat, Thanks a lot for your help with this- that's perfect. After your help here I've watched more video's about Regex today and picked some random samples to play with and get more familiar ...
knight2000 General Coding Help 5 593 Aug-08-2021, 08:46 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020