# Using har\_extractor.py generates ScriptException

**URL:** https://discourse.mitmproxy.org/t/using-har-extractor-py-generates-scriptexception/96
**Category:** help
**Created:** [July 21, 2016, 6:32pm UTC](https://discourse.mitmproxy.org/t/using-har-extractor-py-generates-scriptexception/96 "2016-07-21T18:32:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![bbraz](https://avatars.discourse-cdn.com/v4/letter/b/919ad9/32.png) [@bbraz](https://discourse.mitmproxy.org/u/bbraz)
#### Post date: [July 21, 2016, 6:32pm UTC](https://discourse.mitmproxy.org/t/using-har-extractor-py-generates-scriptexception/96/1 "2016-07-21T18:32:01Z")

</div>

When trying to use the har\_extractor.py script, I keep getting a **ScriptException: No module named ctx** error message when running the following command:

./mitmdump -n -r dumpfile -s “har\_extractor.py test.har”

I’ve installed the ctx module to see if this resolves the issue, but it does not.

Here is the full output:  
$ ./mitmdump -n -r dumpfile -s "har\_extractor.py test.har"  
mitmdump: Traceback (most recent call last):  
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mitmproxy/flow.py”, line 694, in load\_script  
s.load()  
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mitmproxy/script/script.py”, line 85, in load  
sys.exc\_info()[2]  
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mitmproxy/script/script.py”, line 80, in load  
exec (code, self.ns, self.ns)  
File “har\_extractor.py”, line 5, in   
import mitmproxy.ctx  
ScriptException: No module named ctx

Is there an additional module that needs to be installed for this to function correctly?

---

<div class="post-metadata">

### Author: ![mhils](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mitmproxy.org/mhils/32/7_2.png) [@mhils](https://discourse.mitmproxy.org/u/mhils)
#### Post date: [July 23, 2016, 12:52am UTC](https://discourse.mitmproxy.org/t/using-har-extractor-py-generates-scriptexception/96/2 "2016-07-23T00:52:49Z")

</div>

Hi!

It looks like your inline script is from master, but you are using the latest stable release from mitmproxy. Can you please select the right tag on GitHub and try again?

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/mitmproxy1/original/1X/1fbeb36612214a18a7977201fca5f03fa968d2e1.png)

---

<div class="post-metadata">

### Author: ![bbraz](https://avatars.discourse-cdn.com/v4/letter/b/919ad9/32.png) [@bbraz](https://discourse.mitmproxy.org/u/bbraz)
#### Post date: [July 30, 2016, 3:15am UTC](https://discourse.mitmproxy.org/t/using-har-extractor-py-generates-scriptexception/96/3 "2016-07-30T03:15:09Z")

</div>

That did the trick. Thanks!
