-2

I want to scan about 1000 pdf files using "wepawet" which is an online scanner but it takes one file at a time how could I scan the whole 1000 files, could I do that using python ?

https://wepawet.iseclab.org/

could any one help me please? thank you in advance for helping

Jørgen R
  • 10,568
  • 7
  • 42
  • 59
wael omar
  • 3
  • 1

1 Answers1

0

You can automate the process by using python tools like selenium, mechanize or urllib(I'm not sure about urllib). Fill the form using mechanize (a simple example of filling a form and submitting)


    response = br.open(url)
    print response.read() 
    response1 = br.response()
    print response1.read()   
    br.select_form("form1")
    br.form = list(br.forms())[0]
    response = br.submit()
    print response.read()

and submit it as in the code. For more info on mechanize, visit http://www.pythonforbeginners.com/cheatsheet/python-mechanize-cheat-sheet. Hope it works.

T90
  • 567
  • 6
  • 27
  • I have error ImportError: No module named heapq – wael omar Nov 30 '14 at 17:26
  • Can you post the code you have used? – T90 Nov 30 '14 at 17:40
  • thae same one you gave me above========= from mechanize import Browser br = Browser() br.open("https://wepawet.iseclab.org/")=========== br.select_form(name="edit_form") br['file'] = 'C:\Users\Test\Desktop\MultiplePages.pdf' br.submit() – wael omar Nov 30 '14 at 17:52
  • is there a problem because I'm using windows 8 – wael omar Nov 30 '14 at 17:55
  • Windows 8 shouldn't be a problem for mechanize. My question is, where did heapq come from? – T90 Nov 30 '14 at 18:05
  • when I ran the program I had the following: ====== import urllib2, shutil File "C:\Python27\lib\urllib2.py", line 94, in import httplib File "C:\Python27\lib\httplib.py", line 73, in from urlparse import urlsplit File "C:\Python27\lib\urlparse.py", line 119, in from collections import namedtuple File "C:\Python27\lib\collections.py", line 12, in import heapq as _heapq ImportError: No module named heapq – wael omar Nov 30 '14 at 20:10