Posts by João • 69 points
5 posts
-
0
votes2
answers80
viewsQ: exec with n does not work
I’m trying to use the function exec in a code that has \n, but it seems that this function does not support \n a = ''' open('test.txt', 'a').write('Hello, world\n') ''' exec(a) Error: SyntaxError:…
-
1
votes2
answers1313
viewsA: How to extract a text from a page?
I figured out a way to do this using the module html2text import requests import html2text req = requests.get('https://pastebin.com/').text print(html2text.html2text(req))…
-
-3
votes2
answers1313
viewsQ: How to extract a text from a page?
I am creating a web scraping program and would like to know if there is any way to extract the text from a site in this way: This is the html: <div class="s-sidebarwidget s-sidebarwidget__yellow…
-
1
votes1
answer360
viewsQ: How to limit the number of threads running at the same time?
I’m trying to create a proxy checker using multithreading, this is my code: import requests import threading from time import sleep from colorama import Fore url = 'http://google.com' proxyList =…
-
5
votes1
answer113
viewsQ: What is the best way to use threading in this example?
That is the challenge: Create a function that shows an item from a list every second. Using threads, make the program show all items as quickly as possible My code: import threading import time…