Search Results

Search: Posts Made By: bob123
Forum: Programming 03-15-2020
10,101
Posted By bob123
extract the username and the url and print it using Python 3 and BeautifulSoup 4
using python 3 and BeautifulSoup 4
my code when run returns a big list like the txt below
but 100 times more i have only posted one as an example



urls = ['https://example.com']
for url in...
Forum: Programming 03-08-2020
16,315
Posted By bob123
0k got it this works just added a r after MYURL ...
0k got it this works just added a r after MYURL





MYURL=str(pattern.search(script.text).group(0))
MYURL=str.replace(MYURL, r'\u002D', '-')
print(MYURL)
thank you
Forum: Programming 03-08-2020
16,315
Posted By bob123
hi thanks for reply im using python...
hi thanks for reply


im using

python --version


Python 3.7.6 in ubuntu



and the same in windows Python 3.7.6



this did not replace
\u002D -...
Forum: Programming 03-08-2020
16,315
Posted By bob123
yes i want to enhance my python3 script to...
yes i want to

enhance my python3 script to do the replacement



from this
...
Forum: Programming 03-08-2020
16,315
Posted By bob123
hi thanks for reply that just prints the...
hi thanks for reply

that just prints the same url with no change



i need to replace \u002D with -
Forum: Programming 03-08-2020
16,315
Posted By bob123
Python3 replace string with another string
i have this python3 code

urls = ['https://example.com/']
for url in urls:
response = requests.get(url)
soup = BeautifulSoup(response.content, "html.parser")
pattern =...
14,471
Posted By bob123
thank you that works fantastic
thank you

that works fantastic
14,471
Posted By bob123
awk move txt up one line x2
using awk
iam trying to get the title moved up to the line above
the title is between the first and last dashs
some titles have more dashs than others
also need the video size between the 9th...
18,755
Posted By bob123
@nezabudka that works great thank you
@nezabudka

that works great
thank you
18,755
Posted By bob123
thanks for reply that just prints bob ...
thanks for reply


that just prints bob


need to print to line above as in post one
18,755
Posted By bob123
Extract the string between 2 delimiters
using just sed

i am trying to extract the string between 2 delimiters
and print that string to the line above
i cant use the string name as it always different
the delimiters are
: -

this...
Forum: Programming 10-14-2019
7,417
Posted By bob123
i want help with code not for you to write it all...
i want help with code not for you to write it all


in post one you see i ask for help

to get txt betweeen all > </a>


your code works for just one
Forum: Programming 10-14-2019
7,417
Posted By bob123
ok lol i explain more on the page i am...
ok lol i explain more



on the page i am trying to scrape are about 200 of these > </a>
inbetween all of them are different txt
i want all the txt from all of them not just one


your code...
Forum: Programming 10-14-2019
7,417
Posted By bob123
so your saying that will get me all the...
so your saying that will get me all


the txt between all of the > </a>

on the page not just one

as there are about 200 of them all with different txt between them
Forum: Programming 10-14-2019
7,417
Posted By bob123
hi thanks for reply your code did not...
hi thanks for reply


your code did not work

need to get all the txt between all of the > </a>
Forum: Programming 10-12-2019
7,417
Posted By bob123
[Python] BeautifulSoup tags > </a>
using BeautifulSoup
how can i get the txt between all the

> </a>





example
>The Student [2017].mp4</a>
thanks
Forum: Programming 10-12-2019
5,697
Posted By bob123
thanks wisecracker...
thanks wisecracker (https://www.unix.com/member_modal.php?u=302136317&modal=1) works great
Forum: Programming 10-12-2019
5,697
Posted By bob123
Python 3 remove the space after the last /
using python 3 when i run this code to get the urls i get a space in the url

how do i remove the space after the last /

thanks


# Import libraries
import requests
from bs4 import...
2,489
Posted By bob123
hi i cant see how i can ask any different way ...
hi
i cant see how i can ask any different way
i think i made it clear enough

no it wont do what i want as the txt is always different

in post one

i would to do this by line number as the...
2,489
Posted By bob123
sed or awk cuz thats what i use on a linux...
sed or awk
cuz thats what i use on a linux enigma2 box

as for homework nothing to do with homework
im not on any course and im not a student

so can anyone help me with this
thanks
2,489
Posted By bob123
hi rdrtx1 i cant get that to work it just...
hi rdrtx1

i cant get that to work it just hangs in the terminal
nothing happens
2,489
Posted By bob123
hi thanks forgot to say i want to do...
hi thanks

forgot to say

i want to do this with sed or awk
2,489
Posted By bob123
Append by line number
i want to append line 1 of file1
to the beginning of line1 of file2 and keep existing txt
i have tried this sed

sed -n '1p' file1 >> file2

but that goes to line 2

example

file1 looks...
3,388
Posted By bob123
works great many thanks awk -F"/" '{$4 =...
works great
many thanks

awk -F"/" '{$4 = $NF; sub (" > ",_, $4)}1' OFS="/" file
3,388
Posted By bob123
hi rav yes very satisfied all 4 work thank you ...
hi rav yes very satisfied all 4 work
thank you

as for the other way round i ment

take the last string in the line and insert it between 3rd and 4th backslash


from this
...
Showing results 1 to 25 of 44

 
All times are GMT -4. The time now is 02:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy