Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: Saving/editing cookies?
Post: Saving/editing cookies?
I'm scraping a site using Selenium but I find it slow. However, I believe it's possible to retrieve cookie information using Selenium and then proceed using Requests.
Is it possible to retrieve the ... |
|
rhubarbpieguy |
Web Scraping & Web Development |
0 |
910 |
Dec-10-2022, 01:58 PM |
|
|
Thread: Processing "I am not a spammer" with requests
Post: Processing "I am not a spammer" with requests
I'd like to download all posts from a support site. Can I process the "I am not a spammer" button using requests?
The site has a search feature but I'd like to peruse the posts offline. |
|
rhubarbpieguy |
Web Scraping & Web Development |
1 |
1,670 |
Jan-18-2022, 05:09 PM |
|
|
Thread: Alpha numeric element list search
Post: Alpha numeric element list search
I have a list question using the following script:
list1=['a','b','c','d','e','f']
list2=['1A','1B','1C','1a','1b','1c']
list3=[]
list4=[]
for i in list1:
for j in list2:
if i in j: list3.appen... |
|
rhubarbpieguy |
General Coding Help |
1 |
1,779 |
Apr-01-2020, 12:11 PM |
|
|
Thread: Simplifying multiple "or" conditions in if statement.
Post: RE: Simplifying multiple "or" conditions in if sta...
(Jul-22-2017, 09:09 AM)DeaD_EyE Wrote: The last call is every time true, because it's a generator expression.
I hope this explains the use of list/dict/set comprehensions and generator expressions a... |
|
rhubarbpieguy |
General Coding Help |
8 |
102,094 |
Jul-22-2017, 12:19 PM |
|
|
Thread: Simplifying multiple "or" conditions in if statement.
Post: RE: Simplifying multiple "or" conditions in if sta...
(Jul-21-2017, 01:32 PM)DeaD_EyE Wrote: If you want to check if any of the names is in the string, you can write it more compact:
any(name in s for name in ('Bob', 'Ed'))
Wonderful. I knew I could ... |
|
rhubarbpieguy |
General Coding Help |
8 |
102,094 |
Jul-21-2017, 09:01 PM |
|
|
Thread: Simplifying multiple "or" conditions in if statement.
Post: RE: Simplifying multiple "or" conditions in if sta...
Quote:works for me
I'm sorry, I mistyped my example. I meant to search on something not in the string; in the corrected example Ed.
The first works but the second doesn't. However, I was confused ... |
|
rhubarbpieguy |
General Coding Help |
8 |
102,094 |
Jul-21-2017, 11:41 AM |
|
|
Thread: Simplifying multiple "or" conditions in if statement.
Post: Simplifying multiple "or" conditions in if stateme...
The first if statement, with "in s" after each string works. However, the second if statement, combining the strings with parentheses does not.
It seems I shouldn't have to repeat "in s." Is there... |
|
rhubarbpieguy |
General Coding Help |
8 |
102,094 |
Jul-20-2017, 10:35 PM |
|
|
Thread: Zip on single element in nested sequence.
Post: RE: Zip on single element in nested sequence.
The list comprehension works and is what I've used. However,zip(*a)[1] produces:
TypeError: 'zip' object is not subscriptable |
|
rhubarbpieguy |
General Coding Help |
14 |
8,097 |
Jun-29-2017, 09:26 PM |
|
|
Thread: Zip on single element in nested sequence.
Post: Zip on single element in nested sequence.
How do I create the list c=[2,3,4] from the list a=[[1,2,3],[2,3,4],[3,4,5]]? In other words, how do I create a list from element [1] of a list containing nested sequences?
I know b,c,d=zip(*a) produ... |
|
rhubarbpieguy |
General Coding Help |
14 |
8,097 |
Jun-28-2017, 12:23 PM |
|
|
Thread: Inserting carriage return to string.
Post: Inserting carriage return to string.
string='This is sentence 1.Ths is sentence 2.'
print(string) produces: This is sentence 1.This is sentence 2.
However, I'd like to print the string as separate lines. To do so I add what I believe a... |
|
rhubarbpieguy |
General Coding Help |
1 |
3,514 |
Mar-09-2017, 09:35 PM |
|
|
Thread: Python "read -n" equivalent?
Post: RE: Python "read -n" equivalent?
(Jan-23-2017, 10:26 PM)snippsat Wrote: As pointed out bye @micseydel this can be platform(s) depended.
To get it to work like "read -n" command,
has to listen to keyboard event(this is usually calle... |
|
rhubarbpieguy |
General Coding Help |
8 |
6,756 |
Jan-24-2017, 12:51 PM |
|
|
Thread: Python "read -n" equivalent?
Post: RE: Python "read -n" equivalent?
(Jan-23-2017, 02:11 PM)sparkz_alot Wrote: I know very little about bash, but my understanding from this tutorial http://tldp.org/LDP/Bash-Beginners-Guide...08_02.html, is that the 'read -n' command ... |
|
rhubarbpieguy |
General Coding Help |
8 |
6,756 |
Jan-23-2017, 04:13 PM |
|
|
Thread: Python "read -n" equivalent?
Post: Python "read -n" equivalent?
What is the Python equivalent to the bash "read -n" command?
I understand input() pauses for user input. However, if I'm expecting x characters I'd prefer execution to continue without “Enter” once t... |
|
rhubarbpieguy |
General Coding Help |
8 |
6,756 |
Jan-22-2017, 09:05 PM |