scripting

How can I scrape a specific URL from a webpage using BeautifulSoup?

How can I scrape a specific URL from a webpage using BeautifulSoup? Question: I’m writing a Python script that parses HTML (a classifieds website) and sends me email notifications on specific products and price points. Everything works here except for the "listing_url" capture, which I want displayed in the email so I can click on …

Total answers: 1

GPS data storage system

GPS data storage system Question: I have a python script written using twisted module which is running on an ubuntu server as a service. We have many gps devices which sends data every 10 sec. My job is to parse that data and store it in database. Everything is working fine, but total number of …

Total answers: 2

How can I get first executing file name in different script in python?

How can I get first executing file name in different script in python? Question: I have 4 python script files. script_1.py script_2.py script_3.py script_4.py script_1.py, script_2.py and script_3.py calls script_4.py Execute files always change. Like, python script_1.py / python script_2.py / python script_3.py I want to get script_1.py, script_2.py, and script_3.py file name in script_4.py …

Total answers: 2

how to count duplicates in a list of tuples and append it as a new value

how to count duplicates in a list of tuples and append it as a new value Question: output = [(‘studentA’,’ISDF’), (‘studentB’,’CSE’),(‘studentC’,’BIO’),(‘studentA’,’ISDF’), (‘studentB’,’CSE’),(‘studentC’,’BIO’),(‘studentA’,’ISDF’), (‘studentB’,’CSE’),(‘studentC’,’BIO’),(‘studentA’,’ISDF’), (‘studentB’,’CSE’),(‘studentC’,’BIO’),(‘studentA’,’ISDF’), (‘studentB’,’CSE’),(‘studentC’,’BIO’),(‘studentA’,’ISDF’), (‘studentB’,’CSE’),(‘studentC’,’BIO’)] so here there are total of 6 set of (‘studentA’,’ISDF’), (‘studentB’,’CSE’),(‘studentC’,’BIO’) in this above list so Im expecting an output like this ~ expected_output = [(‘studentA’,’ISDF’,6), (‘studentB’,’CSE’,6),(‘studentC’,’BIO’,6)] The format …

Total answers: 4

IDA – execute commands in WinDbg console from python script

IDA – execute commands in WinDbg console from python script Question: I have a python script to run in IDA that generates commands for WinDbg. I also open the memory dump (via the windmp64.dll loader), where the WinDbg console is already available: I want to execute commands in WinDbg console from python script. If I’m …

Total answers: 1

Unable to print TCPcump information using python subprocess

Unable to print TCPcump information using python subprocess Question: I wanted to process tcpdump output in a python script and so far I was able to get to this implementation from subprocess import Popen, PIPE, CalledProcessError import os import signal import time if __name__=="__main__": cmd = ["sudo","tcpdump", "-c","1000","-i","any","port","22","-n"] with Popen(cmd, stdout=PIPE, bufsize=1, universal_newlines=True) as p: …

Total answers: 1

Optimising Python script for scraping to avoid getting blocked/ draining resources

Optimising Python script for scraping to avoid getting blocked/ draining resources Question: I have a fairly basic Python script that scrapes a property website, and stores the address and price in a csv file. There are over 5000 listings to go through but I find my current code times out after a while (about 2000 …

Total answers: 1

How to simulate a pwm semnal python script

How to simulate a pwm semnal python script Question: I need to Simulate Saw-Tooth voltage (4.5 – 0.5V) a total of 30 times . And I don’t know how to do it only with python scripts without special library or something. I have this function, but how I do it to work? def PWM(t, frequency, …

Total answers: 1