Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9035905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:51:53+00:00 2026-06-16T08:51:53+00:00

I am trying to send GET requests but before starting the requests, I’d like

  • 0

I am trying to send GET requests but before starting the requests, I’d like to capture the traffic. Capturing traffic can be done with the command:

dumpcap -i eth0 -f "udp port 53" -w dns.cap

in the background. While I capture packets, I need to make some request by sending some URLs. For now, with the code below, it seems my capturing code does not work, I can not even see a dns.cap file in my folder.

What’s the problem?

import requests
import os
import subprocess
import urllib
print "start capturing packets...\n"
#os.system("dumpcap -i eth0 -f \"udp port 53\" -w dns.cap"
os.spawnl(os.P_NOWAIT,'dumpcap -i eth0 -f \"udp port 53\" -w dns.cap')
print urllib.urlopen('http://www.google.com').read()
#resp = requests.get('http://httpbin.org')
#resp=requests.get('http://httpbin.org')
print "ok"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T08:51:54+00:00Added an answer on June 16, 2026 at 8:51 am

    os.spanwl is considered old and should be replaced with subprocess.Popen. Replace os.spanwnl call with this:

    subprocess.Popen(['/usr/bin/dumpcap', '-i', 'eth0', '-f', 'udp port 53', 
                      '-w', '/tmp/dns.cap'])
    

    It’s better to add some pause (sleep) after starting the dumpcap to ensure that capturing is established when you make requests.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to send a post request to Parse: https://parse.com/docs/rest#objects-creating . Can't get it
I am trying to send get requests to the Google Places API with this
I'm trying to send a http get request in a php file to a
I`m trying to send simple html page with form data to user with GET,
I'm trying to send a getJson call from my app (login form) to get
I'm trying to get a little program to send hex over RS232. From what
I am trying to get jquery's .ajax() to send values sent to a form
I'm using FB.ui to create a send dialog... I'm trying to get a callback
I'm trying to send json string in the get request to the server, here
I am trying to send a simple ajax post request using Mootools but I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.